Closed fermedina closed 7 years ago
Just the way you'd remove values from the standard SharedPreferences: https://stackoverflow.com/questions/8034127/how-to-remove-some-key-value-pair-from-sharedpreferences
But I would like remove a specific entry. I have seen that the keys are encrypted and I don’t know how to remove the key that I would like. Can you help me?
As you don't provide hashed key to store or retrieve a value, you don't need to provide the hashed key for removing a value. Just provide the actual key and the library will handle hashing it appropriately.
But the library doesn't have any method to remove a key/value pair. I want to remove all key/value pair except one. But I don't know how to know which key/value pair doesn't remove, because te key is also encrypted
SecuredPreferenceStore
is a SharedPreferences
implementation hence has all the methods that a SharedPreferences
is supposed to have and behaves similarly.
to remove a key
and associated value call:
SecuredPreferenceStore prefStore = SecuredPreferenceStore.getSharedInstance(getApplicationContext());
prefStore.edit().remove("key").apply();
Hi!
How can I remove my sharedPreferences?