mirror of
https://github.com/vernu/textbee.git
synced 2026-05-18 05:14:49 -04:00
chore(android): add a function to clear a shared pref value
This commit is contained in:
@@ -44,4 +44,11 @@ public class SharedPreferenceHelper {
|
||||
SharedPreferences settings = context.getSharedPreferences(PREF_FILE, 0);
|
||||
return settings.getBoolean(key, defValue);
|
||||
}
|
||||
|
||||
public static void clearSharedPreference(Context context, String key) {
|
||||
SharedPreferences settings = context.getSharedPreferences(PREF_FILE, 0);
|
||||
SharedPreferences.Editor editor = settings.edit();
|
||||
editor.remove(key);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user