ActionBarDrawerToggle with AppCompatActivity and Toolbar Back button with Fragments
问题 I am using the ActionBarDrawerToggle with NavigationView. My content is displayed using fragments. I am following this stackoverflow question to get the back button press to work but control never flows to onOptionsItemSelected . This is my MainActivity.class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer