Exception in MessageQueue callback: handleReceiveCallback

简介: 07-20 14:27:11.477: E/InputEventReceiver(7209): Exception dispatching input event. 07-20 14:27:11.
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
目录
相关文章
|
6月前
|
JavaScript 前端开发
【报错】unhandled error during execution of watcher callback
JavaScript错误`unhandled error during execution of watcher callback`在Echarts图表渲染时出现,通常是因数据未获取到就尝试渲染导致。解决方法是在渲染前添加非空判断,如`if(value){开始渲染数据}`或`if(value !== undefined){开始渲染数据}`,确保数据加载完成后再执行渲染。
869 0
|
6月前
|
消息中间件 存储
Handler
Handler
59 1
|
6月前
|
消息中间件 存储 安全
handler
handler
63 0
如何给所有的 await async 函数添加try/catch?
如何给所有的 await async 函数添加try/catch?
|
前端开发 UED
async/await 函数到底要不要加 try catch ?
async/await 函数到底要不要加 try catch ?
121 0
|
前端开发 Android开发
await不要用try-catch了
直接在 await 后面 catch
163 0
|
缓存 Java Shell
Handler 的 Message 实例怎么获得?为什么不是直接 new?
Handler 的 Message 实例怎么获得?为什么不是直接 new?
|
消息中间件 存储 项目管理
handler+message【消息机制】
handler+message【消息机制】
179 0
handler+message【消息机制】
|
消息中间件 存储 Java
你真的了解Handler吗
今天发一个以前的文章,关于Handler的全面解析,大家看看吧~「周末愉快」!
207 0
你真的了解Handler吗
|
消息中间件 存储 机器学习/深度学习
【Android】Handler 机制 ( Handler | Message | Looper | MessageQueue )(二)
【Android】Handler 机制 ( Handler | Message | Looper | MessageQueue )(二)
140 0