Close the Drawer on BACK button if the Drawer is opened

- otherwise (if Drawer is closed), BACK should work as BACK
into the Fragments BackStack

Change-Id: Ic7f500eb77f35e2142a40e6c9e34c4e7f0ec6428
This commit is contained in:
Fabrice Di Meglio
2014-03-07 12:57:38 -08:00
parent 832e546185
commit c95be4fbb3

View File

@@ -702,6 +702,15 @@ public class SettingsActivity extends Activity
return mFirstHeader;
}
@Override
public void onBackPressed() {
if (mDrawerLayout.isDrawerOpen(mDrawer)) {
mDrawerLayout.closeDrawer(mDrawer);
return;
}
super.onBackPressed();
}
@Override
public void onBackStackChanged() {
setTitleFromBackStack();