Merge "GuidedStepFragment: Fix addAsRoot restoring bug" into mnc-ub-dev

This commit is contained in:
Dake Gu
2016-04-01 21:12:06 +00:00
committed by Android (Google) Code Review
3 changed files with 10 additions and 4 deletions

View File

@@ -68,7 +68,9 @@ public class GuidedStepActivity extends Activity {
Log.v(TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.guided_step_activity);
GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
if (savedInstanceState == null) {
GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
}
}
@Override

View File

@@ -70,7 +70,9 @@ public class GuidedStepSupportActivity extends FragmentActivity {
Log.v(TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.guided_step_activity);
GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
if (savedInstanceState == null) {
GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
}
}
@Override

View File

@@ -29,7 +29,9 @@ public class DialogExampleActivity extends Activity {
super.onCreate(savedInstanceState);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#21272A")));
GuidedStepFragment fragment = new DialogExampleFragment();
GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
if (savedInstanceState == null) {
GuidedStepFragment fragment = new DialogExampleFragment();
GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
}
}
}