1

我在 Play 商店中看到了这个崩溃。

当我检查 framework/base/core/java/android/app/Activity.java 的源代码时

对于 ICS(崩溃发生在 4.0.4)

唯一的解释是应用程序为空!

校验码:

protected void onStop() {
    if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false);
    getApplication().dispatchActivityStopped(this);
    mCalled = true;
}

例外:

java.lang.RuntimeException: Unable to stop activity {my.app/my.app.StartActivity}:  java.lang.NullPointerException
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2588)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:2654)
at android.app.ActivityThread.access$2100(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.Activity.onStop(Activity.java:1301)
at my.app.StartActivity.onStop(StartActivity.java:675)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1169)
at android.app.Activity.performStop(Activity.java:3968)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2583)
... 11 more
4

0 回答 0