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)

  

 

或者另外異常:html

 

 

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
相關文章
相關標籤/搜索