Sie sind auf Seite 1von 1

Many novice in Android development may the Thread and Message, and Handler, Loop er concept is not very

clear, may have similar The content of the adapter has ch anged 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.'s wrong. The following points can be given here to help you understand the proble m: 1 Do not change the adapter Adapter content in the background thread, you must d eal with the UI thread, this can be resolved by Handler coming out. 2 Try Adapter for notifyDataSetChanged () method, of course, look at the specifi c circumstances of your code. Looks like more than just the error message only translated it, the real reason see the source code: mItemCount = mAdapter == null? 0: mAdapter.getCount (); ..... / / Intermediate code is not copied to other else if (mItemCount! = mAdapter.getCount ()) {/ / Here we can see why throw adapter has changed, because you may have threads running, updated mAd apter.getCount (); the return value throw new IllegalStateException ("The content of the adapter has changed but" + "ListView did not receive a notification. Make sure th e content of" + "Your adapter is not modified from a background thread , but only" + "From the UI thread. [In ListView (" + getId () + "," + getClass () + ") With Adapter (" + mAdapter.getClass () + ")]"); } Upstairs buddy in? I also occasionally this happens, but I use to update the dat a AsyncTask system, this problem occurs, ask how to solve? Please +772008232 gui de us thanks .. 1st floor jayaaaiii 2011-11-07 Your question is not very clear. . Is not in addition to the UI thread out with notifyDataSetChanged () outside. . Then if there are other threads to modify the adapter inside. GetCount when this error will be reported. . My program. . Reported a sporadic case of this Excption. Sometimes and sometimes not appear. .

Das könnte Ihnen auch gefallen