Fixed clicking up arrow

This commit is contained in:
ByteHamster 2020-03-16 16:59:47 +01:00
parent ca09df5b1a
commit 78b26fefb5
1 changed files with 2 additions and 7 deletions

View File

@ -182,13 +182,12 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
@Override
public void setSupportActionBar(@Nullable Toolbar toolbar) {
super.setSupportActionBar(toolbar);
drawerLayout.removeDrawerListener(drawerToggle);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,
R.string.drawer_open, R.string.drawer_close);
drawerLayout.addDrawerListener(drawerToggle);
drawerToggle.syncState();
super.setSupportActionBar(toolbar);
}
private void saveLastNavFragment(String tag) {
@ -368,10 +367,6 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
loadChildFragment(fragment, TransitionEffect.NONE);
}
public void dismissChildFragment() {
getSupportFragmentManager().popBackStack();
}
private int getSelectedNavListIndex() {
String currentFragment = getLastNavFragment();
if(currentFragment == null) {
@ -523,7 +518,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
return true;
} else if (item.getItemId() == android.R.id.home) {
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
dismissChildFragment();
getSupportFragmentManager().popBackStack();
}
return true;
} else {