Have the navigation Drawer working with the sherlock actionbar but i am having trouble getting the 3 line icon (like gmail) to show instead of the normal up button \"<\". He
Though I'm guessing by now you must have worked it out, just wanted to submit an answer:
Change your code to the following:
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer,
R.drawable.ic_drawer, R.string.menu_open, R.string.menu_close) {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
getSupportActionBar().setIcon(R.drawable.myIcon);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
Essentially, the ActionBar options that you are setting in code need to be set after the DrawerToggle has been completed, not before.
Have you tried implementing the method:
mDrawerToggle.syncState();
This has worked for me in the past.
May be this will work...
in onCreateOptionMenu inflate your menu layout getSupportMenuInflater().inflate(R.menu.action_bar_menu, menu);
What you can do is create a style like below:
<style name="AppTheme" parent="Your Theme name">
<item name="homeAsUpIndicator">@drawable/ic_drawer</item>
</style>
And in Android manifest apply this theme like:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
This will solve the issue getting the 3 line icon for sure.
Did you add the toggle to your drawer?
mDrawerLayout.setDrawerListener(mDrawerToggle);