ソースを参照

Fixed the back button.

Iñigo Valentin 9 年 前
コミット
c1081f2609

+ 2 - 1
app/src/main/java/com/ivalentin/margolariak/MainActivity.java

@@ -293,7 +293,7 @@ public class MainActivity extends Activity {
 
 		//Replace the fragment.
 		ft.replace(R.id.activity_main_content_fragment, fragment);
-		//ft.addToBackStack(title);
+		ft.addToBackStack(title);
 		ft.commit();
 		setSectionTitle(title);
 		//Set the shareable url
@@ -745,6 +745,7 @@ public class MainActivity extends Activity {
 	public void onBackPressed() {
 		try {
 			FragmentManager fm = getFragmentManager();
+			Log.d("BACK", "StackEntryCount " + fm.getBackStackEntryCount());
 			if (fm.getBackStackEntryCount() > 1) {
 				fm.popBackStack();
 			} else {