Merge branch '782-wrong-item-selected-in-navdrawer-onBackPressed' into 'master'

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

Signed-off-by: goapunk <noobie@goapunks.net>

Closes #782

See merge request !438
This commit is contained in:
akwizgran
2016-11-28 17:07:24 +00:00

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();
}