fix for screens adding up

This commit is contained in:
Roumen Georgiev 2018-05-09 15:44:40 +03:00
parent 41d736e176
commit bfd61a65a0
2 changed files with 3 additions and 12 deletions

View file

@ -47,6 +47,8 @@ public class SWDefinition {
SWDefinition() {
// List all the screens here
if(screens.size() >0)
return;
add(new SWScreen(R.string.nav_setupwizard)
.add(new SWInfotext()
.label(R.string.welcometosetupwizard) )

View file

@ -31,9 +31,8 @@ public class SetupWizardActivity extends AppCompatActivity {
SWDefinition swDefinition = new SWDefinition();
List<SWScreen> screens = swDefinition.getScreens();
private int currentWizardPage = 0;
public static final String INTENT_MESSAGE = "WIZZARDPAGE";
public static final String RESTART = "RESTART";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -62,14 +61,6 @@ public class SetupWizardActivity extends AppCompatActivity {
@Override
protected void onResume() {
Intent intent = new Intent(this, SetupWizardActivity.class);
intent.putExtra(INTENT_MESSAGE, 0);
if(intent.getBooleanExtra(RESTART, false)) {
intent.putExtra(RESTART, false);
this.finish();
startActivity(intent);
}
super.onResume();
MainApp.bus().register(this);
swDefinition.setContext(this);
@ -126,7 +117,6 @@ public class SetupWizardActivity extends AppCompatActivity {
this.finish();
Intent intent = new Intent(this, SetupWizardActivity.class);
intent.putExtra(INTENT_MESSAGE, currentWizardPage + 1);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
@ -137,7 +127,6 @@ public class SetupWizardActivity extends AppCompatActivity {
intent.putExtra(INTENT_MESSAGE, currentWizardPage - 1);
else
intent.putExtra(INTENT_MESSAGE, 0);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}