Last active
June 4, 2017 20:20
-
-
Save krupalshah/e319b9e15ee2ea285e51661c174d54cb to your computer and use it in GitHub Desktop.
helper for shared prefs - kotlin version - Final implementation usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val prefs = defaultPrefs(this) | |
prefs[Consts.SharedPrefs.KEY] = "any_type_of_value" //setter | |
val value: String? = prefs[Consts.SharedPrefs.KEY] //getter | |
val anotherValue: Int? = prefs[Consts.SharedPrefs.KEY, 10] //getter with default value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment