Created
June 4, 2017 19:37
-
-
Save krupalshah/fc758c054c3042d66a703cc6896d75ee to your computer and use it in GitHub Desktop.
helper for shared prefs - kotlin version - usage after refactoring step 4
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
class MainActivity : BaseActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val prefs = PreferenceHelper.defaultPrefs(this) | |
//put value in prefs | |
prefs.setValue(Consts.SharedPrefs.KEY,"any_type_of_value") | |
//get value from prefs | |
val value:String? = prefs.getValue(Consts.SharedPrefs.KEY) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment