ExampleApp/src/com/altinn/apps/fisher/ui/screen/MenuNavigationActivity.java
/**
 * on back if menu is open then it will be closed and user remains in the same screen
 * if menu is not opened in that case on-back press user will be switched to the previous screen
 */
on back if menu is open then it will be closed and user remains in the same screen
if menu is not opened in that case on-back press user will be switched to the previous screen
on back if menu is open then it will be closed and user remains in the same screen if menu is not opened in that case on - back press user will be switched to the previous screen
@Override
	public void onBackPressed() {
		if (!mExcludeMenuNavigation) {
			final int drawerState = mMenuDrawer.getDrawerState();
			if (drawerState == MenuDrawer.STATE_OPEN
					|| drawerState == MenuDrawer.STATE_OPENING) {
				mMenuDrawer.closeMenu();
				return;
			}else {
				super.onBackPressed();
			}
		} else {
			super.onBackPressed();
		}
	}
@ Override public void onBackPressed ( ) { if ( ! mExcludeMenuNavigation ) { final int drawerState = mMenuDrawer . getDrawerState ( ) ; if ( drawerState == MenuDrawer . STATE_OPEN || drawerState == MenuDrawer . STATE_OPENING ) { mMenuDrawer . closeMenu ( ) ; return ; } else { super . onBackPressed ( ) ; } } else { super . onBackPressed ( ) ; } }
on back if menu is open then it will be closed and user remains in the same screen
 if menu is not opened in that case on-back press user will be switched to the previous screen
on back if menu is open then it will be closed and user remains in the same screen if menu is not opened in that case on - back press user will be switched to the previous screen