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,8 +68,10 @@ public class GuidedStepActivity extends Activity {
Log.v(TAG, "onCreate"); Log.v(TAG, "onCreate");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.guided_step_activity); setContentView(R.layout.guided_step_activity);
if (savedInstanceState == null) {
GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host); GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
} }
}
@Override @Override
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {

View File

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

View File

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