为什么会出现崩溃退出我的活动是什么时候?我的、时候

由网友(丶流浪的木偶)分享简介:我遇到崩溃我的应用程序,当我离开(通过后退按钮)我的活性。到目前为止,我可以告诉这是发生在Android codeBase的,与我无关,但我不完全相信这一点。I am experiencing a crash in my app when I quit (via the back button) out of my...

我遇到崩溃我的应用程序,当我离开(通过后退按钮)我的活性。到目前为止,我可以告诉这是发生在Android codeBase的,与我无关,但我不完全相信这一点。

I am experiencing a crash in my app when I quit (via the back button) out of my Activity. So far as I can tell this is happening in the Android codebase and not mine, but I'm not completely convinced of that.

下面是来自亚行的堆栈跟踪:

Here's the stacktrace from adb:

AndroidRuntime  E  Uncaught handler: thread main exiting due to uncaught exception
AndroidRuntime  E  java.lang.RuntimeException: Unable to stop activity {MyApp/MyApp.MainActivity}: java.lang.NullPointerException
AndroidRuntime  E      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3097)
AndroidRuntime  E      at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3159)
AndroidRuntime  E      at android.app.ActivityThread.access$2400(ActivityThread.java:112)
AndroidRuntime  E      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
AndroidRuntime  E      at android.os.Handler.dispatchMessage(Handler.java:99)
AndroidRuntime  E      at android.os.Looper.loop(Looper.java:123)
AndroidRuntime  E      at android.app.ActivityThread.main(ActivityThread.java:3948)
AndroidRuntime  E      at java.lang.reflect.Method.invokeNative(Native Method)
AndroidRuntime  E      at java.lang.reflect.Method.invoke(Method.java:521)
AndroidRuntime  E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
AndroidRuntime  E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
AndroidRuntime  E      at dalvik.system.NativeStart.main(Native Method)
AndroidRuntime  E  Caused by: java.lang.NullPointerException
AndroidRuntime  E      at android.app.Activity.performStop(Activity.java:3575)
AndroidRuntime  E      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3092)
AndroidRuntime  E      ... 11 more

任何人有任何意见/建议?

Anyone have any ideas/recommendations?

推荐答案

不禁大为,因为没有code。 不过在看

Can't help much, as there's no code. Still looking at

引起的:在显示java.lang.NullPointerException   android.app.Activity.performStop(Activity.java:3575)

Caused by: java.lang.NullPointerException at android.app.Activity.performStop(Activity.java:3575)

我只是检查Activity.java

I just checked Activity.java

       final int N = mManagedCursors.size();
        for (int i=0; i<N; i++) {
            ManagedCursor mc = mManagedCursors.get(i); 
            if (!mc.mReleased) {
                mc.mCursor.deactivate(); // line 3575
                mc.mReleased = true;
            }
        }

您确定所有游标被释放正确?

Are you sure all cursors are released properly?

阅读全文

相关推荐

最新文章