@Override public void onBackPressed() { if (menuDrawer != null && menuDrawer.isDrawerOpen()) { menuDrawer.closeDrawer(); } else { super.onBackPressed(); } }
@Override public void onBackPressed() { if (result != null && result.isDrawerOpen()) { result.closeDrawer(); } else { super.onBackPressed(); } }
@Override public void onBackPressed() { if (drawer.isDrawerOpen()) { drawer.closeDrawer(); } else if (!curFrag.onBackPressed()) { if (fragmentManager.getBackStackEntryCount() == 0) drawer.openDrawer(); else super.onBackPressed(); } }
@Override public void onBackPressed() { // handle the back press :D close the drawer first and if the drawer is closed close the // activity if (result != null && result.isDrawerOpen()) { result.closeDrawer(); } else { super.onBackPressed(); } }
@Override public void onBackPressed() { if (drawer != null && drawer.isDrawerOpen()) { drawer.closeDrawer(); } else { if (mBackPressed + TIME_INTERVAL > System.currentTimeMillis()) { super.onBackPressed(); return; } else { Toast.makeText(getBaseContext(), R.string.press_back_again_toast, Toast.LENGTH_SHORT) .show(); } mBackPressed = System.currentTimeMillis(); } }
public boolean isDrawerOpen() { return drawer.isDrawerOpen(); }