找不到类似的问题,所以:
我有类似的例外报告.它并没有指向我申请的任何地方.我认为当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.NullPointerExceptionat androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:1956)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)at androID.app.ActivityThread.handle@R_550_4404@Activity(ActivityThread.java:3351)at androID.app.ActivityThread.access0(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.NullPointerExceptionat 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
提前致谢!
解决方法:
再次发现一个肮脏的工作.
感谢Bill Blume对产生问题的方法有所了解.
Jus覆盖活动的onRestoreInstanceState方法并处理如下所示的异常.
@OverrIDeprotected voID onRestoreInstanceState(Bundle savedInstanceState) { try{ super.onRestoreInstanceState(savedInstanceState); }catch (Exception e) { System.out.println("Exce"); }}
再次感谢Bil Blume
总结以上是内存溢出为你收集整理的View.dispatchRestoreInstanceState中的NullPointerException(View.java:9938)Android 4.0.3 / 4.0.4全部内容,希望文章能够帮你解决View.dispatchRestoreInstanceState中的NullPointerException(View.java:9938)Android 4.0.3 / 4.0.4所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)