0

请指教我的代码有什么问题。???

STACK_TRACE=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(2131296324, class android.widget.ListView) with Adapter(class com.platinumapps.platinumtasks.ActionsAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1556)
at android.widget.AbsListView$CheckForTap.run(AbsListView.java:2868)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4126)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
4

2 回答 2

0

在下面调用这个,把它放在一个线程中

             runOnUiThread(new Runnable(){
                 @Override
                 public void run() {
                    // call it here
                 }  
             }
于 2012-05-24T05:49:32.233 回答
0

使用Handlers,UI-threadsAsyncTask(postexecute) 调用notifydatasetchanged();. 您正在后台线程中执行此操作...

于 2012-05-24T06:00:29.177 回答