summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/leapclient')
-rw-r--r--src/se/leap/leapclient/ConfigurationWizard.java6
-rw-r--r--src/se/leap/leapclient/Dashboard.java20
2 files changed, 22 insertions, 4 deletions
diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java
index 6a7bd10c..f759b37e 100644
--- a/src/se/leap/leapclient/ConfigurationWizard.java
+++ b/src/se/leap/leapclient/ConfigurationWizard.java
@@ -118,8 +118,10 @@ public class ConfigurationWizard extends Activity
}
}
- Intent dashboardIntent = new Intent(this, Dashboard.class);
- startActivity(dashboardIntent);
+ // FIXME!! We're going to have more Fragments and listeners, flow control?
+ // TODO There is no testing done to know if we're okay...
+ setResult(RESULT_OK);
+ finish();
}
}
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index b6110aac..dce99b1e 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -18,6 +18,8 @@ import android.widget.TextView;
public class Dashboard extends Activity {
+ protected static final int CONFIGURE_LEAP = 0;
+
private static SharedPreferences preferences;
private static Provider provider;
@@ -34,11 +36,25 @@ public class Dashboard extends Activity {
// Check if we have preferences, run configuration wizard if not
// TODO We should do a better check for config that this!
if (!preferences.contains("provider") )
- startActivity(new Intent(this, ProviderListActivity.class));
+ startActivityForResult(new Intent(this,ConfigurationWizard.class),CONFIGURE_LEAP);
else
buildDashboard();
}
-
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data){
+ if ( requestCode == CONFIGURE_LEAP ) {
+ if ( resultCode == RESULT_OK ){
+ // Configuration done, get our preferences again
+ preferences = getSharedPreferences(ConfigHelper.PREFERENCES_KEY,MODE_PRIVATE);
+
+ buildDashboard();
+ } else {
+ // Something went wrong... TODO figure out what
+ // TODO Error dialog
+ }
+ }
+ }
private void buildDashboard() {
// Get our provider