// requires access to the activity
val sharedPreferencesFile = activity?.get()?.let {
it.getSharedPreferences("${it.packageName}_preferences", Context.MODE_PRIVATE)
} ?: return
val whateverString = sharedPreferencesFile.getString("key_for_whatever_you_have_stored_there", "default value")
Created
June 16, 2022 14:32
-
-
Save ca057/cd60dcb40a6ba289a6ccee7bc15988c6 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment