Created
March 15, 2023 10:19
-
-
Save Dzendo/c2901faf09bc889ca52f719811f3d174 to your computer and use it in GitHub Desktop.
Declaralion and find SharedPreference from device
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
// Declaralion and find SharedPreference from device | |
shPr = PreferenceManager.getDefaultSharedPreferences(this /* Activity context */) | |
// If you save values between sessions - then false (if there are none, then it will create) | |
// Если сохранять значения между сеансами, то false (если их нет, то создаст) | |
if (shPr.getBoolean("preference_remember", true)) | |
preferencesReset(false) // if not reset at startup to Default | |
else | |
preferencesReset(true) // if reset at startup to Default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment