diff options
Diffstat (limited to 'samples/SupportLeanbackDemos/src')
2 files changed, 12 insertions, 8 deletions
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java index 7dda7ffaa..fdec4d88c 100644 --- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java +++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java @@ -173,7 +173,7 @@ public class GuidedStepActivity extends Activity { if (action.getId() == CONTINUE) { GuidedStepFragment.add(fm, new SecondStepFragment(), android.R.id.content); } else { - getActivity().finish(); + finishGuidedStepFragments(); } } @@ -348,15 +348,17 @@ public class GuidedStepActivity extends Activity { @Override public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) { addAction(actions, CONTINUE, "Done", "All finished"); - addAction(actions, BACK, "Back", "Forgot something..."); + addAction(actions, BACK, "Start Over", "Let's try this again..."); } @Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == CONTINUE) { - getActivity().finish(); + finishGuidedStepFragments(); } else { - getFragmentManager().popBackStack(); + // pop 4, 3, 2 + popBackStackToGuidedStepFragment(SecondStepFragment.class, + FragmentManager.POP_BACK_STACK_INCLUSIVE); } } diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java index 1fb7cfafa..5ac34dd37 100644 --- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java +++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java @@ -175,7 +175,7 @@ public class GuidedStepSupportActivity extends FragmentActivity { if (action.getId() == CONTINUE) { GuidedStepSupportFragment.add(fm, new SecondStepFragment(), android.R.id.content); } else { - getActivity().finish(); + finishGuidedStepSupportFragments(); } } @@ -350,15 +350,17 @@ public class GuidedStepSupportActivity extends FragmentActivity { @Override public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) { addAction(actions, CONTINUE, "Done", "All finished"); - addAction(actions, BACK, "Back", "Forgot something..."); + addAction(actions, BACK, "Start Over", "Let's try this again..."); } @Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == CONTINUE) { - getActivity().finish(); + finishGuidedStepSupportFragments(); } else { - getFragmentManager().popBackStack(); + // pop 4, 3, 2 + popBackStackToGuidedStepSupportFragment(SecondStepFragment.class, + FragmentManager.POP_BACK_STACK_INCLUSIVE); } } |