Android DrawerLayout component -
i have problems drawerlayout component. i'm using android-support-v4 jar , when i'm launching app have exception :
05-19 01:33:57.402: e/androidruntime(3120): fatal exception: main 05-19 01:33:57.402: e/androidruntime(3120): java.lang.runtimeexception: unable start activity componentinfo{com.dimosphere.app/com.dimosphere.app.mainactivity}: android.view.inflateexception: binary xml file line #1: error inflating class android.support.v4.widget.drawerlayout 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.performlaunchactivity(activitythread.java:2307) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2357) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.access$600(activitythread.java:153) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread$h.handlemessage(activitythread.java:1247) 05-19 01:33:57.402: e/androidruntime(3120): @ android.os.handler.dispatchmessage(handler.java:99) 05-19 01:33:57.402: e/androidruntime(3120): @ android.os.looper.loop(looper.java:137) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.main(activitythread.java:5226) 05-19 01:33:57.402: e/androidruntime(3120): @ java.lang.reflect.method.invokenative(native method) 05-19 01:33:57.402: e/androidruntime(3120): @ java.lang.reflect.method.invoke(method.java:511) 05-19 01:33:57.402: e/androidruntime(3120): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:795) 05-19 01:33:57.402: e/androidruntime(3120): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:562) 05-19 01:33:57.402: e/androidruntime(3120): @ dalvik.system.nativestart.main(native method) 05-19 01:33:57.402: e/androidruntime(3120): caused by: android.view.inflateexception: binary xml file line #1: error inflating class android.support.v4.widget.drawerlayout 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:698) 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.inflate(layoutinflater.java:466) 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.inflate(layoutinflater.java:396) 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.inflate(layoutinflater.java:352) 05-19 01:33:57.402: e/androidruntime(3120): @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:323) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activity.setcontentview(activity.java:1881) 05-19 01:33:57.402: e/androidruntime(3120): @ com.dimosphere.app.mainactivity.oncreate(mainactivity.java:12) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activity.performcreate(activity.java:5104) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.performlaunchactivity(activitythread.java:2261) 05-19 01:33:57.402: e/androidruntime(3120): ... 11 more 05-19 01:33:57.402: e/androidruntime(3120): caused by: java.lang.classnotfoundexception: didn't find class "android.support.v4.widget.drawerlayout" on path: /data/app/com.dimosphere.app-2.apk 05-19 01:33:57.402: e/androidruntime(3120): @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:65) 05-19 01:33:57.402: e/androidruntime(3120): @ java.lang.classloader.loadclass(classloader.java:501) 05-19 01:33:57.402: e/androidruntime(3120): @ java.lang.classloader.loadclass(classloader.java:461) 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.createview(layoutinflater.java:552) 05-19 01:33:57.402: e/androidruntime(3120): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:687) 05-19 01:33:57.402: e/androidruntime(3120): ... 20 more
i don't understand why have exception, included jar in project properties...
here xml file :
<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- main content view --> <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- navigation drawer --> <listview android:id="@+id/left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:choicemode="singlechoice" android:divider="@android:color/transparent" android:dividerheight="0dp" android:background="#111"/> </android.support.v4.widget.drawerlayout>
if have idea problem, you're welcome... :)
add android-support-v4 build path
Comments
Post a Comment