private static Set<Activity> getActivitiesInStages(Stage... stages) { final Set<Activity> activities = Sets.newHashSet(); final ActivityLifecycleMonitor instance = ActivityLifecycleMonitorRegistry.getInstance(); for (Stage stage : stages) { final Collection<Activity> activitiesInStage = instance.getActivitiesInStage(stage); if (activitiesInStage != null) { activities.addAll(activitiesInStage); } } return activities; }
public static Set<Activity> getActivitiesInStages(Stage... stages) { final Set<Activity> activities = Sets.newHashSet(); final ActivityLifecycleMonitor instance = ActivityLifecycleMonitorRegistry.getInstance(); for (Stage stage : stages) { final Collection<Activity> activitiesInStage = instance.getActivitiesInStage(stage); if (activitiesInStage != null) { activities.addAll(activitiesInStage); } } return activities; }
public static Set<Activity> getActivitiesInStages(Stage... stages) { final Set<Activity> activities = Sets.newHashSet(); final ActivityLifecycleMonitor instance = ActivityLifecycleMonitorRegistry.getInstance(); for (Stage stage : stages) { activities.addAll(instance.getActivitiesInStage(stage)); } return activities; }
public static Set<Activity> getActivitiesInStages(Stage... stages) { final Set<Activity> activities = new HashSet<>(); final ActivityLifecycleMonitor instance = ActivityLifecycleMonitorRegistry.getInstance(); for (Stage stage : stages) { final Collection<Activity> activitiesInStage = instance.getActivitiesInStage(stage); if (activitiesInStage != null) { activities.addAll(activitiesInStage); } } return activities; }
private static Activity getCurrentActivityOnMainThread() { ActivityLifecycleMonitor registry = ActivityLifecycleMonitorRegistry.getInstance(); Collection<Activity> activities = registry.getActivitiesInStage(Stage.RESUMED); return activities.iterator().hasNext() ? activities.iterator().next() : null; }