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