Example #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;
 }
Example #2
0
 public static boolean isCached(Context context) {
   return (boolean) SPUtil.get(context, KEY_IS_CACHE, false, KEY_FILE_NAME);
 }
Example #3
0
 private void setIsCached(Context context, boolean isCached) {
   SPUtil.put(context, KEY_IS_CACHE, isCached, KEY_FILE_NAME);
 }
Example #4
0
 private void endCache() {
   setIsCached(this, true);
   SPUtil.put(this, KEY_LAST_SCAN_TIME, System.currentTimeMillis(), KEY_FILE_NAME);
 }