get

suspend fun <T> get(context: Context, key: Preferences.Key<T>, default: T): T

Gets the last value stored at key, or returns default if there are no stored values.

Author

Arnau Mora

Since

20220829

Return

The data stored at key or default if any.

Parameters

context

The context that is requesting the data.

key

The preferences key of the preference.

default

What to return if there's no stored data at key.