decodeOrDefault

inline fun <T> Preferences.decodeOrDefault(tag: String, default: T): T

Decodes and deserializes from the SharedPreferences at the specified tag to the value of type T using deserializer retrieved from the reified type parameter.

Parameters

tag

key to decode data from

default

default value, if no object was encoded at tag