From 784ccaac0ba10ee0121b402fb7ec37cdfd9ef341 Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 9 Feb 2015 23:13:02 +0100 Subject: [PATCH] Wrong step in WizardActivity fixed --- .../android/calculator/wizard/WizardActivity.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardActivity.java b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardActivity.java index d4fa9d83..4abe9c1b 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardActivity.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardActivity.java @@ -55,25 +55,20 @@ public class WizardActivity extends BaseActivity implements WizardsAware, Shared public void onPageSelected(int position) { final WizardStep step = flow.getStepAt(position); wizardUi.setStep(step); + WizardUi.tryPutStep(getIntent(), 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) { final int position = flow.getPositionFor(wizardUi.getStep()); pager.setCurrentItem(position); } + if (wizard.getLastSavedStepName() == null) { + wizard.saveLastStep(wizardUi.getStep()); + } + App.getPreferences().registerOnSharedPreferenceChangeListener(this); }