在我的代码中引用一行时没有错误崩溃

时间:2018-04-30 10:57:27

标签: android

大家好我正在开发一个实时在屏幕上绘制信号的应用程序。这个应用程序通过蓝牙从PCB获取数据,并绘制图中的值。我现在有问题。我有3个活动(主要,监控,btavailable)一个线程(监听器)。从主要我按一个连接按钮,我进入btavailable等待此活动的结果。一旦我有了结果,我就开始监控活动,该活动抛出线程从蓝牙听。如果我回去,主要活动被调用,所以我可以再次按下连接按钮。当我再次按下连接按钮时,我的目的是直接调用监视活动,但是...应用程序从头开始重新启动而不打开监视活动。似乎应用程序执行了几次,当我尝试使用btavailable监视应用程序重新启动连接时。我正在使用graphview,我能看到的唯一错误似乎来自那里。在我的行代码中,Android不会给我一个错误,这是最糟糕的情况,你肯定知道。

这是我的错误:

04-30 12:50:37.860 12375-12375/com.example.utente.lets_appv0 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.example.utente.lets_appv0, PID: 12375
                                                                           java.lang.IllegalArgumentException: Capacity: -8
                                                                               at java.util.HashMap.<init>(HashMap.java:140)
                                                                               at java.util.HashMap.<init>(HashMap.java:174)
                                                                               at java.util.LinkedHashMap.<init>(LinkedHashMap.java:119)
                                                                               at java.util.LinkedHashMap.<init>(LinkedHashMap.java:97)
                                                                               at java.util.LinkedHashMap.<init>(LinkedHashMap.java:81)
                                                                               at com.jjoe64.graphview.GridLabelRenderer.adjustVertical(GridLabelRenderer.java:768)
                                                                               at com.jjoe64.graphview.GridLabelRenderer.adjustSteps(GridLabelRenderer.java:932)
                                                                               at com.jjoe64.graphview.GridLabelRenderer.draw(GridLabelRenderer.java:1067)
                                                                               at com.jjoe64.graphview.GraphView.drawGraphElements(GraphView.java:299)
                                                                               at com.jjoe64.graphview.GridLabelRenderer.draw(GridLabelRenderer.java:1062)
                                                                               at com.jjoe64.graphview.GraphView.drawGraphElements(GraphView.java:299)
                                                                               at com.jjoe64.graphview.GraphView.onDraw(GraphView.java:323)
                                                                               at android.view.View.draw(View.java:14465)
                                                                               at android.view.View.getDisplayList(View.java:13362)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.getDisplayList(View.java:13357)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.draw(View.java:14468)
                                                                               at android.widget.FrameLayout.draw(FrameLayout.java:472)
                                                                               at android.view.View.getDisplayList(View.java:13362)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.draw(View.java:14468)
                                                                               at android.support.v7.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:444)
                                                                               at android.view.View.getDisplayList(View.java:13362)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.getDisplayList(View.java:13357)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.getDisplayList(View.java:13357)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.View.draw(View.java:14182)
                                                                               at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
                                                                               at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
                                                                               at android.view.View.draw(View.java:14468)
                                                                               at android.widget.FrameLayout.draw(FrameLayout.java:472)
                                                                               at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2329)
                                                                               at android.view.View.getDisplayList(View.java:13362)
                                                                               at android.view.View.getDisplayList(View.java:13404)
                                                                               at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1570)
                                                                               at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1449)
                                                                               at android.view.ViewRootImpl.draw(ViewRootImpl.java:2383)
                                                                               at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2255)
                                                                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1885)
                                                                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
                                                                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5672)
                                                                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:772)
                                                                               at android.view.Choreographer.doCallbacks(Choreographer.java:585)
                                                                               at android.view.Choreographer.doFrame(Choreographer.java:555)
                                                                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:758)
                                                                               at android.os.Handler.handleCallback(Handler.java:733)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                            at android.os.Looper.loo

另外两个错误是:

04-30 12:50:38.480 2375-2375/? E/SearchServiceStarter: Task 174 failed or timed out. Client 10446885107087741 disconnecting from SearchService!
                                                   java.util.concurrent.CancellationException: Task was cancelled.
                                                       at com.google.common.util.concurrent.d.da(SourceFile:80)
                                                       at com.google.common.util.concurrent.d.get(SourceFile:62)
                                                       at com.google.common.util.concurrent.cf.o(SourceFile:2)
                                                       at com.google.common.util.concurrent.ax.m(SourceFile:50)
                                                       at com.google.common.util.concurrent.az.run(SourceFile:5)
                                                       at com.google.android.apps.gsa.shared.util.concurrent.a.bf.run(SourceFile:2)
                                                       at android.os.Handler.handleCallback(Handler.java:733)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:136)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5017)
                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:515)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
                                                       at dalvik.system.NativeStart.main(Native Method)

04-30 12:50:38.660 801-9057/? E/ctxmgr: [BaseServerTask]Server task (FetchAclSet) got error statusCode=-1.
                                    com.android.volley.VolleyError: Unable to obtain auth token - is the device online?
                                        at djc.a(com.google.android.gms@12221034@12.2.21 (034-188803320):62)
                                        at dej.run(com.google.android.gms@12221034@12.2.21 (034-188803320):2)
                                        at deh.handleMessage(com.google.android.gms@12221034@12.2.21 (034-188803320):3)
                                        at koh.run(com.google.android.gms@12221034@12.2.21 (034-188803320):6)
                                        at kot.run(com.google.android.gms@12221034@12.2.21 (034-188803320):26)
                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                        at kus.run(com.google.android.gms@12221034@12.2.21 (034-188803320))
                                        at java.lang.Thread.run(Thread.java:841)

我不知道最后两个错误是否与第一个错误相关,但是你知道,StackOverflow很想问。

无论如何,谢谢大家:)

0 个答案:

没有答案