找不到类似的问题,所以:我有一堆类似异常的报告。它并没有指向我的应用程序的任何地方。我假设当 App 试图恢复视图状态并且传递给容器的对象为空时,可能会发生这种情况。
我正在使用 android-support-v4 lib 片段 + Parcelable接口将数据存储在对话框片段中。API 16 的 Android 项目目标,使用 Project API 16。
据报道,此崩溃仅出现在 4.0.3 和 4.0.4 设备上。
有没有人遇到过这样的问题?
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my/com.my.activities.MyActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3351)
at android.app.ActivityThread.access$700(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.view.View.dispatchRestoreInstanceState(View.java:9938)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2318)
at android.view.View.restoreHierarchyState(View.java:9921)
at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1625)
at android.app.Activity.onRestoreInstanceState(Activity.java:906)
at android.app.Activity.performRestoreInstanceState(Activity.java:878)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1100)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
... 12 more
提前致谢!