我有以下异常,我无法理解这个原因。我尝试使用谷歌搜索,但未能找到合适的解决方案。有人可以让我知道造成这种异常的原因。
java.lang.IllegalStateException: The specified message queue synchronization barrier token has not been posted or has already been removed.
09-09 15:28:53.967: W/System.err(20676): at android.os.MessageQueue.removeSyncBarrier(MessageQueue.java:266)
09-09 15:28:53.967: W/System.err(20676): at android.os.Looper.removeSyncBarrier(Looper.java:242)
09-09 15:28:53.967: W/System.err(20676): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1222)
09-09 15:28:53.967: W/System.err(20676): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5089)
09-09 15:28:53.967: W/System.err(20676): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
09-09 15:28:53.967: W/System.err(20676): at android.view.Choreographer.doCallbacks(Choreographer.java:591)
09-09 15:28:53.967: W/System.err(20676): at android.view.Choreographer.doFrame(Choreographer.java:561)
09-09 15:28:53.967: W/System.err(20676): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
09-09 15:28:53.967: W/System.err(20676): at android.os.Handler.handleCallback(Handler.java:725)
09-09 15:28:53.967: W/System.err(20676): at android.os.Handler.dispatchMessage(Handler.java:92)
09-09 15:28:53.967: W/System.err(20676): at android.os.Looper.loop(Looper.java:137)
09-09 15:28:53.967: W/System.err(20676): at android.app.ActivityThread.main(ActivityThread.java:5283)
09-09 15:28:53.967: W/System.err(20676): at java.lang.reflect.Method.invokeNative(Native Method)
09-09 15:28:53.967: W/System.err(20676): at java.lang.reflect.Method.invoke(Method.java:511)
09-09 15:28:53.967: W/System.err(20676): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
09-09 15:28:53.967: W/System.err(20676): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
09-09 15:28:53.967: W/System.err(20676): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:0)
我无法粘贴代码,因为它是处理程序的巨大代码。这是多年来一些人写的。
感谢Sash_KP您的链接解决了这个问题。我之前看过它,但不确定哪个处理程序导致了这个问题。
通过将对Handler的sendMessage方法的调用更改为dispatchMessage来解决此问题。