File tree Expand file tree Collapse file tree
source-code/app/src/main/java/org/buildmlearn/toolkit/activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public void onNavigationDrawerItemSelected(int position) {
8282 if (currentSection == null || selectedMenuItem != currentSection ) {
8383 currentSection = selectedMenuItem ;
8484 FragmentManager fm = getFragmentManager ();
85- FragmentTransaction ft = fm .beginTransaction ().setTransition (FragmentTransaction .TRANSIT_FRAGMENT_FADE );
85+ FragmentTransaction ft = fm .beginTransaction ().setTransition (FragmentTransaction .TRANSIT_FRAGMENT_FADE ). addToBackStack ( null ) ;
8686 Fragment f = fm .findFragmentById (R .id .container );
8787 if (f != null ) {
8888 if (currentSection .isKeep ()) {
@@ -111,6 +111,9 @@ public void onBackPressed() {
111111 mNavigationDrawerFragment .closeDrawer ();
112112 return ;
113113 }
114+ if (getFragmentManager ().getBackStackEntryCount () <= 1 ) {
115+ finish ();
116+ }
114117 super .onBackPressed ();
115118 }
116119}
You can’t perform that action at this time.
0 commit comments