Last active
July 16, 2020 14:42
-
-
Save yangweigbh/ea3324562ffc3120bac07d145c90c24d to your computer and use it in GitHub Desktop.
This file contains 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
long lastExitTimestamp = getPreferences(0).getLong(PREV_DETECT_TIME_KEY, 0); | |
List<ApplicationExitInfo> unprocessedExitInfos = new ArrayList<>(); | |
for (ApplicationExitInfo exitInfo: applicationExitInfos) { | |
if (exitInfo.getTimestamp() > lastExitTimestamp) { | |
unprocessedExitInfos.add(exitInfo); | |
} else { | |
break; | |
} | |
} | |
if (unprocessedExitInfos.size() > 0) { | |
getPreferences(0).edit().putLong(PREV_DETECT_TIME_KEY, unprocessedExitInfos.get(0).getTimestamp()).apply(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment