getBoolean

abstract suspend fun getBoolean(key: String, defValue: Boolean): Boolean

Reads the Boolean value stored under key, returning defValue if absent.

Return

The stored boolean, or defValue.

Parameters

key

Storage key to look up.

defValue

Value returned when key is not found.

Throws

if the stored value cannot be read or cast to Boolean.

for any other storage-layer error.

CancellationException

if the calling coroutine is cancelled.