Skip to content

Commit

Permalink
log activity state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mg4gh committed Jul 6, 2024
1 parent 66c700f commit bb02e85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ public void afterGroupFinished(BgJobGroup jobGroup, int total, int success, int
registerActivityLifecycleCallbacks(new ActivityLifecycleAdapter() {
@Override
public void onActivityResumed(@NonNull Activity activity) {
super.onActivityResumed(activity);
escalationCnt[0] = 0; // escalation is reset whenever any activity is resumed
finishAlarm();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,46 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.lang.invoke.MethodHandles;

import mg.mgmap.generic.util.basic.MGLog;

public class ActivityLifecycleAdapter implements Application.ActivityLifecycleCallbacks {

private static final MGLog mgLog = new MGLog(MethodHandles.lookup().lookupClass().getName());

@Override
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivityStarted(@NonNull Activity activity) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivityResumed(@NonNull Activity activity) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivityPaused(@NonNull Activity activity) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivityStopped(@NonNull Activity activity) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {

mgLog.d(activity.getClass().getName());
}

@Override
public void onActivityDestroyed(@NonNull Activity activity) {

mgLog.d(activity.getClass().getName());
}
}

0 comments on commit bb02e85

Please sign in to comment.