summaryrefslogtreecommitdiffstats
path: root/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java
diff options
context:
space:
mode:
authorDake Gu <dake@google.com>2015-10-28 20:20:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-28 20:20:17 +0000
commit23ee659cba7f4375d2beb3f39289937f425b2666 (patch)
tree9f4b83952f168efed87d684187ac6d0207bef1c5 /samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java
parent5493040235ba2fe70b129f51a69dc2ed8e52a393 (diff)
parentd80cfde31d25b0ff2783a0b593fc9b73481972d3 (diff)
downloadandroid_development-23ee659cba7f4375d2beb3f39289937f425b2666.tar.gz
android_development-23ee659cba7f4375d2beb3f39289937f425b2666.tar.bz2
android_development-23ee659cba7f4375d2beb3f39289937f425b2666.zip
Merge "SupportLeanbackDemo: add example finishGuidedStepFragments()" into mnc-ub-dev
Diffstat (limited to 'samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java')
-rw-r--r--samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java10
1 files changed, 6 insertions, 4 deletions
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);
}
}