Created
June 30, 2010 13:18
-
-
Save loganj/458626 to your computer and use it in GitHub Desktop.
This file contains 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
protected boolean persistBoolean(boolean value) { | |
if (shouldPersist()) { | |
if (value == getPersistedBoolean(!value)) { | |
// It's already there, so the same as persisting | |
return true; | |
} | |
SharedPreferences.Editor editor = mPreferenceManager.getEditor(); | |
editor.putBoolean(mKey, value); | |
tryCommit(editor); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment