0

重新启动活动后:

Intent intent = getIntent();
finish();
startActivity(intent);

应用程序在没有任何参考我的源代码的情况下崩溃:

FATAL EXCEPTION: main
     java.lang.NullPointerException
     at android.view.ViewGroup.dispatchCollectViewAttributes(ViewGroup.java:980)
     at android.view.ViewGroup.dispatchCollectViewAttributes(ViewGroup.java:980)
     at android.view.ViewGroup.dispatchCollectViewAttributes(ViewGroup.java:980)
     at android.view.ViewGroup.dispatchCollectViewAttributes(ViewGroup.java:980)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1262)
     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2628)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:137)
     at android.app.ActivityThread.main(ActivityThread.java:4511)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:511)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
     at dalvik.system.NativeStart.main(Native Method)

它只在设备上发生过几次。有什么想法可能是错的吗?

4

1 回答 1

2

为什么不用Activity#recreate来做作业?

于 2013-02-22T13:02:09.373 回答