getInt

fun getInt(key: String?, defValue: Int): Int

Retrieves an int value from the shared preferences.

Return

The preference value if it exists, otherwise defValue.

Parameters

key

The name of the preference to retrieve.

defValue

Value to return if the preference does not exist.

Throws

If there is a preference with this name that is not an int.