summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java10
-rw-r--r--samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java10
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);
}
}