今天做项目点击listview的item时总是报错,下面是部分报错日志
02-06 10:58:39.207: E/InputEventReceiver(764): Exception dispatching input event.
02-06 10:58:39.207: E/MessageQueue-JNI(764): Exception in MessageQueue callback:handleReceiveCallback02-06 10:58:39.377: E/MessageQueue-JNI(764): 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(16908298, class android.widget.ListView) with Adapter(class android.widget.SimpleAdapter)]
02-06 10:58:39.377: E/MessageQueue-JNI(764): at android.widget.ListView.layoutChildren(ListView.java:1538)
原因是我在onRestart里面清除了listview,然后重新请求了,但是这个时候忘记重新刷新adapter了,所以在listviw数据更改的时候要记得刷新adapter,不然就会报错