diff options
author | Parménides GV <parmegv@sdf.org> | 2013-06-29 14:03:15 +0200 |
---|---|---|
committer | Sean Leonard <meanderingcode@aetherislands.net> | 2013-07-12 11:54:52 -0600 |
commit | b684f2fdd35064210d7c5ae760c1a2e4939b1ec5 (patch) | |
tree | 7b9ece739e4435488820072f4353cc751837cb72 /src/se/leap/leapclient/ConfigHelper.java | |
parent | 6a8a4acdca2c0828c2768a18a470ee64525e0d7f (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.java | 16 |
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. |