使用导航抽屉创建活动时关闭应用程序

时间:2013-12-24 11:10:21

标签: android android-activity navigation-drawer

我有一个问题。在Android上。我用登录表单(2 editview和按钮)创建了main_activity,在用户登录应用程序后,我在布局中创建了带导航抽屉的新活动,但应用程序崩溃了。有什么建议?谢谢。

这是logcat:

12-25 08:39:17.136: D/AndroidRuntime(27818): Shutting down VM
12-25 08:39:17.136: W/dalvikvm(27818): threadid=1: thread exiting with uncaught exception (group=0x41fbf300)
12-25 08:39:17.146: E/AndroidRuntime(27818): FATAL EXCEPTION: main
12-25 08:39:17.146: E/AndroidRuntime(27818): java.lang.RuntimeException: Unable to start activity ComponentInfo{elogika.elogikamobileclient/elogika.elogikamobileclient.HomeActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.v4.widget.DrawerLayout
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.os.Handler.dispatchMessage(Handler.java:99)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.os.Looper.loop(Looper.java:137)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread.main(ActivityThread.java:4745)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at java.lang.reflect.Method.invokeNative(Native Method)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at java.lang.reflect.Method.invoke(Method.java:511)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:810)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:577)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at dalvik.system.NativeStart.main(Native Method)
12-25 08:39:17.146: E/AndroidRuntime(27818): Caused by: android.view.InflateException:  Binary XML file line #19: Error inflating class android.support.v4.widget.DrawerLayout
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.Activity.setContentView(Activity.java:1867)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at elogika.elogikamobileclient.HomeActivity.onCreate(HomeActivity.java:13)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.Activity.performCreate(Activity.java:5008)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-25 08:39:17.146: E/AndroidRuntime(27818):    ... 11 more
12-25 08:39:17.146: E/AndroidRuntime(27818): Caused by: java.lang.ClassNotFoundException: android.support.v4.widget.DrawerLayout
12-25 08:39:17.146: E/AndroidRuntime(27818):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
12-25 08:39:17.146: E/AndroidRuntime(27818):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
12-25 08:39:17.146: E/AndroidRuntime(27818):    ... 20 more
12-25 08:39:17.166: W/ActivityManager(23861): Process elogika.elogikamobileclient has crashed too many times: killing!
12-25 08:39:17.166: W/ActivityManager(23861):   Force finishing activity elogika.elogikamobileclient/.HomeActivity
12-25 08:39:17.166: W/ActivityManager(23861):   Force finishing activity elogika.elogikamobileclient/.MainActivity
12-25 08:39:17.176: I/ActivityManager(23861): Killing proc 27818:elogika.elogikamobileclient/u0a63: crash
12-25 08:39:17.266: I/WindowState(23861): WIN DEATH: Window{42901a50 elogika.elogikamobileclient/elogika.elogikamobileclient.MainActivity paused=true}

0 个答案:

没有答案