Fix Contacts Item always beeing selected if Back is pressed in the NavMenu

Signed-off-by: goapunk <noobie@goapunks.net>
This commit is contained in:
goapunk
2016-11-28 16:29:41 +01:00
parent 47171f3e18
commit cfcd36f21a

View File

@@ -193,14 +193,14 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
@Override
public void onBackPressed() {
// Check the Contacts item because we always return to Contacts here
NavigationView navigation = (NavigationView) findViewById(R.id.navigation);
navigation.getMenu().findItem(R.id.nav_btn_contacts).setChecked(true);
if (getSupportFragmentManager().getBackStackEntryCount() == 0
&& drawerLayout.isDrawerOpen(START)) {
drawerLayout.closeDrawer(START);
return;
}
// Check the Contacts item because we always return to Contacts here
NavigationView navigation = (NavigationView) findViewById(R.id.navigation);
navigation.getMenu().findItem(R.id.nav_btn_contacts).setChecked(true);
super.onBackPressed();
}