mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Select the correct MenuItem when Back is pressed in NawDrawer
Signed-off-by: goapunk <noobie@goapunks.net>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user