问题描述
我想实现我的Android应用程序抽屉式导航栏。我用这个教程:的
这说明,以实现与使用碎片的抽屉式导航栏。但是,我的应用程序强制关闭,因为我想在10 API运行它(姜饼)
但它仅适用于3.0蜂窝+。我如何使它在2.3姜饼+,并在全屏模式下工作。请我需要帮助!
在此先感谢!
堆栈跟踪
16 01-09:01:07.971 16470-16470 / com.Chinmay.navigationdrawer E / AndroidRuntime:致命异常:主要
java.lang.NoSuchMethodError:com.Chinmay.navigationdrawer.MainActivity.getActionBar
在com.Chinmay.navigationdrawer.MainActivity.onCreate(MainActivity.java:25)
在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
在android.app.ActivityThread.access $ 1500(ActivityThread.java:117)
在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:935)
在android.os.Handler.dispatchMessage(Handler.java:99)
在android.os.Looper.loop(Looper.java:130)
在android.app.ActivityThread.main(ActivityThread.java:3687)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:507)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:867)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
在dalvik.system.NativeStart.main(本机方法)
抽屉式导航不提供的Android 2.3姜饼。您必须使用应用程序兼容性支持库在旧版本中使用抽屉式导航栏。这是一个很好的教程here
I am trying to implement navigation drawer in my android app. I used This tutorial : http://manishkpr.webheavens.com/android-navigation-drawer-example-using-fragments/which shows to implement the navigation drawer with the use of fragments. But my app force closes as I am trying to run it on API 10 (Gingerbread)
But it works only on 3.0 Honeycomb+. How do I make it work on 2.3 Gingerbread+ and in fullscreen mode. Please I need help!
Thanks in advance!
StackTrace
01-09 16:01:07.971 16470-16470/com.Chinmay.navigationdrawer E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoSuchMethodError: com.Chinmay.navigationdrawer.MainActivity.getActionBar
at com.Chinmay.navigationdrawer.MainActivity.onCreate(MainActivity.java:25)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Navigation Drawer is not available for Android 2.3 Gingerbread. You must use AppCompat support library to use Navigation Drawer on older versions. There is a good tutorial here
这篇关于抽屉式导航栏2.3姜饼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!