I am using the ActionBarDrawerToggle with NavigationView. My content is displayed using fragments.
I am following this stackoverflow question to get the back button pres
Remove this line
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
from onOptionsItemSelected()
so it will look like this
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// doesn't reach here ever.
return true;
case R.id.action_x:
// do something
return true;
case R.id.action_y:
// do something
return true;
default:
return super.onOptionsItemSelected(item);
}
}