Skip to content
Snippets Groups Projects
Commit 47171f3e authored by goapunk's avatar goapunk
Browse files

Select the correct MenuItem when Back is pressed in NawDrawer


Signed-off-by: default avatargoapunk <noobie@goapunks.net>
parent 6fc42f72
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