Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Report - java.lang.IllegalStateException in android.widget.ListView.layoutChildren #5

Closed
thehitechpanky opened this issue Nov 23, 2014 · 7 comments

Comments

@thehitechpanky
Copy link
Collaborator

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131230722, class android.widget.ListView) with Adapter(class com.smilyo.main.DrawerListAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1538)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:3148)
at android.view.View.dispatchTouchEvent(View.java:5545)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
at android.app.Activity.dispatchTouchEvent(Activity.java:2391)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
at android.view.View.dispatchPointerEvent(View.java:5725)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2928)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2492)
at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:870)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2501)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

@thehitechpanky thehitechpanky changed the title java.lang.IllegalStateException in android.widget.ListView.layoutChildren Crash Report - java.lang.IllegalStateException in android.widget.ListView.layoutChildren Nov 23, 2014
@warwicky
Copy link

warwicky commented Dec 8, 2014

You cannot modify ui elements from a background thread. If you are running a thread use handler or runinui method if you are using asynctask. You can modify with runinui method as well as onpostExecute and onPreExecute methods of async class

@thehitechpanky
Copy link
Collaborator Author

Thanks for acknowledging @warwicky
Would you like to resolve the issue and send us a pull request ? We'll be happy to add you as contributor if you can help us.

@warwicky
Copy link

warwicky commented Dec 9, 2014

@thehitechpanky I'am sorry i can not contrbute it. I have been working on 2 projects right now. I do not have much time actually. I suggest you to post it on stackoverflow. You can also take a look at some tutorials about asycntask, handlers, threads, runnables in android. Hope that helps. GL.

@thehitechpanky
Copy link
Collaborator Author

Thanks for the help @warwicky :)

@mikedasuya
Copy link

i can fix this, please let me know how to proceed further....We can run it on runUiThread

@thehitechpanky
Copy link
Collaborator Author

@mikedasuya you can fork it, commit your changes, and send us a pull request.

@mikedasuya
Copy link

I tried to pull,i run it, it crahses as url is null, can you share the url ......also i will fix your bugs and send the code ......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants