I can get a String
from the shared preferences by using:
sharedPreferences.getString("key_name","default value");
But how can I check if key_name
is actually a String
?
What if it is a Boolean key value?
Is there a method we can use like:
if(sharedPreferences.isTypeOf(Boolean,"key_name")) {}
SharedPreferences
values. – MarguritemargygetAll()
which returnsMap<String, ?>
, and then usinginstanceof
to test type. Even though it doesn't make any sense – Anaclinal