Skip to content

Instantly share code, notes, and snippets.

View r4jiv007's full-sized avatar
🎯
Focusing

Rajiv Singh r4jiv007

🎯
Focusing
View GitHub Profile
@thsaravana
thsaravana / AppTransitionStatus.java
Last active March 2, 2020 04:24
Used to identify when the app goes to foreground or background
public final class AppTransitionStatus implements Application.ActivityLifecycleCallbacks {
private static final long MAX_BACKGROUND_TIME = 2000;
private Timer timer;
private TimerTask task;
private boolean isBackground = true;
private final Transition transition;
public AppTransitionStatus(@NonNull Transition transition) {