forked from shihaam/thijooree
add clear cache
This commit is contained in:
@@ -51,6 +51,10 @@ object ContactsCache {
|
||||
prefs.apply()
|
||||
}
|
||||
|
||||
fun clear(context: Context) {
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().clear().apply()
|
||||
}
|
||||
|
||||
fun loadContacts(context: Context): List<MibBeneficiary> {
|
||||
val json = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
|
||||
.getString(KEY_CONTACTS, null) ?: return emptyList()
|
||||
|
||||
Reference in New Issue
Block a user