summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigHelper.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-06-29 14:03:15 +0200
committerSean Leonard <meanderingcode@aetherislands.net>2013-07-12 11:54:52 -0600
commitb684f2fdd35064210d7c5ae760c1a2e4939b1ec5 (patch)
tree7b9ece739e4435488820072f4353cc751837cb72 /src/se/leap/leapclient/ConfigHelper.java
parent6a8a4acdca2c0828c2768a18a470ee64525e0d7f (diff)
Pressing back button, we don't choose any provider
Once in the provider detail fragment, if the user presses the back button, provider.json is removed from sharedpreferences (so that Dashboard does not start as if the user had selected the canceled provider) and ConfigurationWizard gets the focus.
Diffstat (limited to 'src/se/leap/leapclient/ConfigHelper.java')
-rw-r--r--src/se/leap/leapclient/ConfigHelper.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/se/leap/leapclient/ConfigHelper.java b/src/se/leap/leapclient/ConfigHelper.java
index e0496422..559c8e03 100644
--- a/src/se/leap/leapclient/ConfigHelper.java
+++ b/src/se/leap/leapclient/ConfigHelper.java
@@ -164,9 +164,7 @@ public class ConfigHelper {
*/
public static String getStringFromSharedPref(String shared_preferences_key) {
String content = null;
- if ( checkSharedPrefs() ) {
- content = shared_preferences.getString(shared_preferences_key, "");
- }
+ content = shared_preferences.getString(shared_preferences_key, "");
return content;
}
@@ -196,6 +194,18 @@ public class ConfigHelper {
}
return value;
}
+
+ /*
+ * This method defaults to false.
+ * If you use this method, be sure to fail-closed on false!
+ * TODO This is obviously less than ideal...solve it!
+ */
+ public static boolean removeFromSharedPref(String shared_preferences_key) {
+ SharedPreferences.Editor shared_preferences_editor = shared_preferences
+ .edit();
+ shared_preferences_editor.remove(shared_preferences_key);
+ return shared_preferences_editor.commit();
+ }
/**
* Opens a FileInputStream from the user directory of the external storage directory.