I'm using the new DrawerLayout
to have side navigation. I'm using the drawer icon (the 'hamburger') like this:
@Override protected void onStart() { super.onStart(); mDrawerLayout = (DrawerLayout) findViewById(R.id.activity_main_drawerlayout); mDrawerToggle = new ActionBarDrawerToggle( this, mDrawerLayout, R.drawable.ic_navigation_drawer, R.string.app_name, R.string.app_name); mDrawerLayout.setDrawerListener(mDrawerToggle); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); }
However, when I add a Fragment
to the backstack, I want to display the back arrow again, so the user can navigate back to "home", and only then open the app drawer.
How can I reset the drawer icon to the back icon?
The arrow I want:
To disable and hide the DrawerToggle "Hamburger", just call
mDrawerToggle.setDrawerIndicatorEnabled(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With