示例#1
0
 private boolean isStartCache() {
   long oldTime = (long) SPUtil.get(this, KEY_LAST_SCAN_TIME, 0l, KEY_FILE_NAME);
   if (System.currentTimeMillis() - oldTime > UPDATE_DURATION) {
     return true;
   }
   return false;
 }
示例#2
0
 public static boolean isCached(Context context) {
   return (boolean) SPUtil.get(context, KEY_IS_CACHE, false, KEY_FILE_NAME);
 }
示例#3
0
 private void setIsCached(Context context, boolean isCached) {
   SPUtil.put(context, KEY_IS_CACHE, isCached, KEY_FILE_NAME);
 }
示例#4
0
 private void endCache() {
   setIsCached(this, true);
   SPUtil.put(this, KEY_LAST_SCAN_TIME, System.currentTimeMillis(), KEY_FILE_NAME);
 }