rey5137 / material

A library to bring fully animated Material Design components to pre-Lolipop Android.
http://rey5137.com/material/
Apache License 2.0
6.01k stars 1.32k forks source link

Crash app when i use Snipper after clicking an item #267

Open nakeman opened 9 years ago

nakeman commented 9 years ago

我给Snipper绑定简单的arrayadpter用于测试,居然在点选一项后当掉。从错误代码上看到点击处理,且错误出现在其后(Spinner.onDataInvalidated)一个addview行为,这是干什么的呢?我不明白。

for testing , I bind the spinner with a simple adapter, but crash after selecting an item. From error output ,we can find the select / click event handle, and a strange Spinner.onDataInvalidated follow, in that a serial addView behavior , What that for??

09-29 15:39:34.836 17378-17378/cn.wildlife.sugeladi E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:3491) at android.view.ViewGroup.addView(ViewGroup.java:3362) at android.view.ViewGroup.addView(ViewGroup.java:3307) at android.view.ViewGroup.addView(ViewGroup.java:3283) at com.rey.material.widget.Spinner.onDataInvalidated(Spinner.java:927) at com.rey.material.widget.Spinner.setSelection(Spinner.java:422) at com.rey.material.widget.Spinner.performItemClick(Spinner.java:898) at com.rey.material.widget.Spinner$DropdownPopup$3.onItemClick(Spinner.java:1271) at com.rey.material.widget.Spinner$DropDownAdapter.onClick(Spinner.java:1140) at android.view.View.performClick(View.java:4171) at android.view.View$PerformClick.run(View.java:17097) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4914) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575) at dalvik.system.NativeStart.main(Native Method)

nakeman commented 9 years ago

似乎它说我绑定了一些非法的数据(onDataInvalidated),然后往布局了添加一些提示(addView)?哪什么的数据为合法?我用了一些三个个email地址。

It seem I binding invalided data, fired the onDataInvalidated event handler, in that some view be added to layout for reminding. well ,what valid data be define? I use some email addresses.

aumidbek commented 9 years ago

Duplicate of https://github.com/rey5137/material/issues/219

shiran4 commented 8 years ago

is this solved? i am using the newest snapshot and this is happening to me too

rey5137 commented 8 years ago

@shiran4 Can you please try 1.2.2 version and see if it's fixed.

shiran4 commented 8 years ago

This is the version I used and it still occurred at the time I wrote you. I am using the android spinner for now but would prefer to use your library :)

rey5137 commented 8 years ago

Can you post your code and xml?