Navigationdrawer With Actionbarsherlok
Solution 1:
I just got this running on my project, which was an even more major pain because I'm using Maven.
Don't include the support library in your project, but replace the support library in the ActionBarSherlock lib folder, which is r7, with the newest r13 version. Others have said that you need to include private libraries in the order and export as well, which was not true for me because I'm using Maven.
This tutorial was helpful in getting ABS and DrawerLayout to work together.
Solution 2:
Try this and let me know if it doesn't solve the issue :
- Go to Build Path > Configure Build Path > Order and Export
- Check Android and Android Dependencies libraries
- Clean and rebuild your Project
Solution 3:
Do you have the latest support library installed? The class android.support.v4.widget.DrawerLayout is only in the latest library from around a month ago (version 13).
Solution 4:
I had the same problem. So I solved it using the following steps. It ll be useful to others.
The problem is because the compiler searching drawer_layout
in the activity_main.xml
.
setContentView(R.layout.activity_main);
//You added the view file as activity_main
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
//While execution the compiler will search "drawer_layout" in the view file (activity_main.xml). But the drawer_layout is in some other xml file.
But there is no "drawer_layout"
is added in the activity_main.xml
. Its added in some other xml file
So, To solve this problem we need to add the following in the activity_main.xml.
<android.support.v4.widget.DrawerLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/drawer_layout"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/bff"><FrameLayoutandroid:id="@+id/content_frame"android:layout_width="match_parent"android:layout_height="match_parent" /><ListViewandroid: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"/><!-- The content in the activity_main.xml --></android.support.v4.widget.DrawerLayout>
Post a Comment for "Navigationdrawer With Actionbarsherlok"