有时会出现以下错误后,从最近的应用程序中选择应用程序。我找不到此异常的原因。
这里我使用的是 ActionBarActivity。
AndroidRuntime(23268): FATAL EXCEPTION: main
E/AndroidRuntime(23268): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.adventnet.webmon.android/com.adventnet.webmon.android.NavigationDrawerBaseActivity}: java.lang.NullPointerException
E/AndroidRuntime(23268): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
E/AndroidRuntime(23268): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
E/AndroidRuntime(23268): at android.app.ActivityThread.access$700(ActivityThread.java:140)
E/AndroidRuntime(23268): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
E/AndroidRuntime(23268): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(23268): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(23268): at android.app.ActivityThread.main(ActivityThread.java:4921)
E/AndroidRuntime(23268): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(23268): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(23268): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
E/AndroidRuntime(23268): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/AndroidRuntime(23268): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(23268): Caused by: java.lang.NullPointerException
E/AndroidRuntime(23268): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2831)
E/AndroidRuntime(23268): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2832)
E/AndroidRuntime(23268): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2832)
E/AndroidRuntime(23268): at android.view.View.restoreHierarchyState(View.java:12206)
E/AndroidRuntime(23268): at android.support.v4.app.Fragment.restoreViewState(Fragment.java:425)
E/AndroidRuntime(23268): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:949)
E/AndroidRuntime(23268): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
E/AndroidRuntime(23268): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
E/AndroidRuntime(23268): at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1877)
E/AndroidRuntime(23268): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:552)
E/AndroidRuntime(23268): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1178)
E/AndroidRuntime(23268): at android.app.Activity.performStart(Activity.java:5216)
E/AndroidRuntime(23268): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2083)
E/AndroidRuntime(23268): ... 11 more`
谢谢,嘘。