
ASimpleCache可以缓存哪些东西
-
普通的字符串
-
JsonObject
-
JsonArray
-
Bitmap
-
Drawable
-
序列化的java对象
-
byte数据
ASimpleCache的示例代码
ACache mCache = ACache.get(this);
mCache.put("test_key1", "test value");
mCache.put("test_key2", "test value", 10);//保存10秒,如果超过10秒去获取这个key,将为null
mCache.put("test_key3", "test value", 2 * ACache.TIME_DAY);//保存两天,如果超过两天去获取这个key,将为null
获取缓存数据:
ACache mCache = ACache.get(this);
String value = mCache.getAsString("test_key1");




近期评论