Skip to content
Snippets Groups Projects
Commit 2b9ccb4c authored by Ernir Erlingsson's avatar Ernir Erlingsson
Browse files

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


Select the correct MenuItem when Back is pressed in NawDrawer

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

Closes #782

See merge request !437
parents 6436e668 47171f3e
No related branches found
No related tags found
No related merge requests found
......@@ -183,12 +183,19 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
drawerLayout.closeDrawer(START);
clearBackStack();
loadFragment(item.getItemId());
//Don't display the Settings Item as checked
if(item.getItemId() == R.id.nav_btn_settings){
return false;
}
return true;
}
@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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment