Created
November 9, 2018 10:40
-
-
Save isfaaghyth/5e41cbc72f3403a851e7c2f89ff95a30 to your computer and use it in GitHub Desktop.
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
| public class CacheManager { | |
| private static final String TAG = "CacheManager"; | |
| private static SharedPreferences getPref() { | |
| return PreferenceManager.getDefaultSharedPreferences(RangerApplication.getContext()); | |
| } | |
| public static void save(String key, String value) { | |
| Log.d(TAG, "saveCache: " + value); | |
| getPref().edit().putString(key, value).apply(); | |
| } | |
| public static String grab(String key) { | |
| return getPref().getString(key, null); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment