Exception in MessageQueue callback: handleReceiveCallback

07-20 14:27:11.477: E/InputEventReceiver(7209): Exception dispatching input event.
07-20 14:27:11.477: E/MessageQueue-JNI(7209): Exception in MessageQueue callback: handleReceiveCallback
07-20 14:27:11.497: E/MessageQueue-JNI(7209): 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(2131362042, class com.edaixi.swipemenu.widget.SwipeMenuListView) with Adapter(class com.edaixi.swipemenu.widget.SwipeMenuListView$1)]
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.widget.ListView.layoutChildren(ListView.java:1544)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.widget.AbsListView.onTouchEvent(AbsListView.java:3410)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.edaixi.swipemenu.widget.SwipeMenuListView.onTouchEvent(SwipeMenuListView.java:194)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.View.dispatchTouchEvent(View.java:7257)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2171)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1906)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1920)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1920)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1920)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1920)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2002)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1454)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.app.Activity.dispatchTouchEvent(Activity.java:2418)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1950)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.View.dispatchPointerEvent(View.java:7437)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3331)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3241)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4403)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4382)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4474)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.os.MessageQueue.nativePollOnce(Native Method)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.os.MessageQueue.next(MessageQueue.java:125)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.os.Looper.loop(Looper.java:124)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at android.app.ActivityThread.main(ActivityThread.java:5106)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at java.lang.reflect.Method.invoke(Method.java:511)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
07-20 14:27:11.497: E/MessageQueue-JNI(7209): at dalvik.system.NativeStart.main(Native Method)
07-20 14:27:11.497: W/dalvikvm(7209): threadid=1: thread exiting with uncaught exception (group=0x40c2d930)

  

或者另外异常:

Tag:MessageQueue-JNI
Exception dispatching input event.
Exception in MessageQueue callback: handleReceiveCallback
java.lang.NullPointerException
………………………………………………………………

  

多次触发触摸屏事件,导致对同一个事件处理的消息过多,当第一个消息已处理完事件并销毁事件时,由于该事件已销毁但还没来得及通知销毁第二个同样的消息,当主线程执行第二个消息时,由于获取不了该事件,所以抛出异常。
 
解决:用try..catch..包围TouchEvent事件处理。完美解决,java基础用法。
 
参考:http://blog.sina.com.cn/s/blog_6ddbf6920101m7dl.html
上一篇:delete、update忘加where条件误操作恢复过程演示


下一篇:Spring对hibernate的事物管理