summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigurationWizard.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-07-12 13:35:04 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-07-12 14:27:03 -0600
commit1ba2d488737bdb84847bbbc7cf9038610b1f094b (patch)
tree0b30e1136dfbe3a367627cf1cc011f1f6d1fe0b3 /src/se/leap/leapclient/ConfigurationWizard.java
parent210b562bd474e7d8c22becf62ea52399f0a6d9f9 (diff)
parent84d3b5f6967c0bac2a740627386ff92b6e283b16 (diff)
Merge branch 'feature/back-button-in-configuration-wizard' into develop
Diffstat (limited to 'src/se/leap/leapclient/ConfigurationWizard.java')
-rw-r--r--src/se/leap/leapclient/ConfigurationWizard.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java
index 23220e79..d12fdc77 100644
--- a/src/se/leap/leapclient/ConfigurationWizard.java
+++ b/src/se/leap/leapclient/ConfigurationWizard.java
@@ -154,10 +154,22 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
@Override
public void onBackPressed() {
+ try {
+ if(ConfigHelper.getJsonFromSharedPref(ConfigHelper.PROVIDER_KEY) == null || ConfigHelper.getJsonFromSharedPref(ConfigHelper.PROVIDER_KEY).length() == 0) {
+ askDashboardToQuitApp();
+ } else {
+ setResult(RESULT_OK);
+ }
+ } catch (JSONException e) {
+ askDashboardToQuitApp();
+ }
+ super.onBackPressed();
+ }
+
+ private void askDashboardToQuitApp() {
Intent ask_quit = new Intent();
ask_quit.putExtra(ConfigHelper.QUIT, ConfigHelper.QUIT);
setResult(RESULT_CANCELED, ask_quit);
- super.onBackPressed();
}
private ProviderItem getProvider(String id) {