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