|
|
@ -44,4 +44,11 @@ public class SharedPreferenceHelper { |
|
|
SharedPreferences settings = context.getSharedPreferences(PREF_FILE, 0); |
|
|
SharedPreferences settings = context.getSharedPreferences(PREF_FILE, 0); |
|
|
return settings.getBoolean(key, defValue); |
|
|
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(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |