Wrong step in WizardActivity fixed

This commit is contained in:
serso 2015-02-09 23:13:02 +01:00
parent 4a58f03ca3
commit 784ccaac0b

View File

@ -55,25 +55,20 @@ public class WizardActivity extends BaseActivity implements WizardsAware, Shared
public void onPageSelected(int position) { public void onPageSelected(int position) {
final WizardStep step = flow.getStepAt(position); final WizardStep step = flow.getStepAt(position);
wizardUi.setStep(step); wizardUi.setStep(step);
WizardUi.tryPutStep(getIntent(), step);
wizard.saveLastStep(step); wizard.saveLastStep(step);
} }
}); });
final String lastSavedStepName = wizard.getLastSavedStepName();
if (lastSavedStepName == null) {
wizard.saveLastStep(wizardUi.getStep());
} else {
final WizardStep step = wizard.getFlow().getStepByName(lastSavedStepName);
if (step != null) {
wizardUi.setStep(step);
}
}
if (savedInstanceState == null) { if (savedInstanceState == null) {
final int position = flow.getPositionFor(wizardUi.getStep()); final int position = flow.getPositionFor(wizardUi.getStep());
pager.setCurrentItem(position); pager.setCurrentItem(position);
} }
if (wizard.getLastSavedStepName() == null) {
wizard.saveLastStep(wizardUi.getStep());
}
App.getPreferences().registerOnSharedPreferenceChangeListener(this); App.getPreferences().registerOnSharedPreferenceChangeListener(this);
} }