我的Android应用程序的错误报告,但我不知道原因,它来自哪里

时间:2017-09-27 05:31:03

标签: android android-studio illegalstateexception

在我的应用中,我实现了Fabric(错误报告)

在Fabric中我得到了如下的崩溃报告。但我真的不知道原因,我的错误在哪里指出。 我想这个错误指的是原生Android代码。我怎么能解决它?

Everything(MessageQueue,ViewRootImpl ..)不是我的自定义代码。请告诉我任何建议,这些错误会导致我的应用停止运行?

Fatal Exception: java.lang.IllegalStateException: The specified message queue synchronization  barrier token has not been posted or has already been removed.
       at android.os.MessageQueue.removeSyncBarrier(MessageQueue.java:512)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1496)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7044)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
       at android.view.Choreographer.doCallbacks(Choreographer.java:702)
       at android.view.Choreographer.doFrame(Choreographer.java:638)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.os.HandlerThread.run(HandlerThread.java:61)

我使用下面的处理程序编码。 有什么问题吗?

if(_intent.getAction()。equals(Intent.ACTION_SCREEN_ON)){                         ringerType =" screenOn&#34 ;;

                    $trafficTimer = new Timer(true);
                    $trafficTimerTask = new TimerTask() {
                        @Override
                        public void run() {
                            try {
                                Intent intent = new Intent(getApplicationContext(), SQLiteHandler.class);
                                intent.putExtra("CATEGORY", "NR(DATA)");
                                intent.putExtra("TIMESTAMP", new SimpleDateFormat("yyyy.MM.dd_HH.mm.ss").format(new Date(System.currentTimeMillis())));
                                intent.putExtra("TRANSMIT", "" + (TrafficStats.getTotalTxBytes()) / 1024 + " KB");
                                intent.putExtra("RECEIVE", "" + (TrafficStats.getTotalRxBytes()) / 1024 + " KB");

                                PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
                                pendingIntent.send();
                            } catch (PendingIntent.CanceledException e) {
                                e.printStackTrace();
                            }
                        }
                    };

                    $trafficTimer.schedule($trafficTimerTask, 0, 10 * 1000);
                } else if (_intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
                    ringerType = "screenOff";

                    if ($trafficTimer != null) {
                        $trafficTimer.cancel();
                        $trafficTimer = null;
                    }

0 个答案:

没有答案