如何为 API 8 及更高版本的导航抽屉添加向后兼容性。
日志猫:
11-11 16:12:31.796: E/AndroidRuntime(621): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.navigationdrawerexample/com.example.android.navigationdrawerexample.MainActivity}: java.lang.ClassNotFoundException: com.example.android.navigationdrawerexample.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android.navigationdrawerexample-2.apk]
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.os.Looper.loop(Looper.java:123)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-11 16:12:31.796: E/AndroidRuntime(621): at java.lang.reflect.Method.invokeNative(Native Method)
11-11 16:12:31.796: E/AndroidRuntime(621): at java.lang.reflect.Method.invoke(Method.java:521)
11-11 16:12:31.796: E/AndroidRuntime(621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-11 16:12:31.796: E/AndroidRuntime(621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-11 16:12:31.796: E/AndroidRuntime(621): at dalvik.system.NativeStart.main(Native Method)
11-11 16:12:31.796: E/AndroidRuntime(621): Caused by: java.lang.ClassNotFoundException: com.example.android.navigationdrawerexample.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android.navigationdrawerexample-2.apk]
11-11 16:12:31.796: E/AndroidRuntime(621): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
11-11 16:12:31.796: E/AndroidRuntime(621): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
11-11 16:12:31.796: E/AndroidRuntime(621): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-11 16:12:31.796: E/AndroidRuntime(621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
11-11 16:12:31.796: E/AndroidRuntime(621): ... 11 more