getString

fun getString(key: String, defaultValue: String = ""): String?

Function to get String value from preference

Return

String from given key if exist, defaultValue if not

Parameters

key

String key to refer

defaultValue

String to return if the key doesn't return any value