I've implemented the ActionBarDrawerToggle with the hamburger icon (support library v7), but for some reason the toggle only displays a 'back' arrow on devices not running 5.0 (I have confirmed this for all 4.x versions). Is this normal behaviour?
The arrow looks like this:
Now the arrow icon doesn't change. It's the same when the navigation drawer is pulled out, or when it is in collapsed mode.
This is how I initalize the drawertoggle etc.
// drawer toggle
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.string.drawer_open, R.string.drawer_close);
mDrawerLayout.setDrawerListener(mDrawerToggle);
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
EDIT
For some clarification. I am using the old regular ActionBar, not the Toolbar. The hamburger icon DOES show on 5.0 devices but not on < 5.0. Should I use the toolbar to fix this problem?
In order to get the hamburger icon this piece of code below is enough
Toolbar toolbar =(Toolbar)findViewById(R.id.app_bar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
it's showing back button because you are using the method setDisplayHomeAsUpEnabled(true);
Check out the official reference Click here
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