Skip to content

Instantly share code, notes, and snippets.

@TerryJung
Created September 20, 2023 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TerryJung/9629c6caa2dfd3e1cd51707f0afcae53 to your computer and use it in GitHub Desktop.
Save TerryJung/9629c6caa2dfd3e1cd51707f0afcae53 to your computer and use it in GitHub Desktop.
SharedPrefHelper
object SharedPrefHelper {
const val USER_ID = "user_id"
const val SHARED_PREF = "shared-pref"
fun getUserID(context:Context) :String {
return context.getSharedPreferences(SHARED_PREF, MODE_PRIVATE).getString(USER_ID, "")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment