I've been working on upgrading my app for Android API 21, and have gotten it mostly working with support library v7. However, because of these changes, the Navigation Drawer Indicator (hamburger menu button) no longer gets displayed.
It used to be that the indicator icon was set in the ActionBarDrawerToggle() method, but this is no longer the case in support lib v7.
There is another version of ActionBarDrawerToggle() that takes a ToolBar object. Do I have to have a Toolbar in addition to my Actionbar to bring back the Drawer Indicator?
What else would do the trick?
Here's my actionbar code.
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
// ActionBarDrawerToggle ties together the the proper interactions
// between the sliding drawer and the action bar app icon
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
// R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
) {
public void onDrawerClosed(View view) {
getSupportActionBar().setTitle(mTitle);
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(mDrawerTitle);
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.setDrawerListener(mDrawerToggle);