本文整理汇总了Java中android.support.test.runner.lifecycle.ActivityLifecycleMonitor类的典型用法代码示例。如果您正苦于以下问题:Java ActivityLifecycleMonitor类的具体用法?Java ActivityLifecycleMonitor怎么用?Java ActivityLifecycleMonitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActivityLifecycleMonitor类属于android.support.test.runner.lifecycle包,在下文中一共展示了ActivityLifecycleMonitor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActivitiesInStages
import android.support.test.runner.lifecycle.ActivityLifecycleMonitor; //导入依赖的package包/类
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;
}
示例2: getActivitiesInStages
import android.support.test.runner.lifecycle.ActivityLifecycleMonitor; //导入依赖的package包/类
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;
}
示例3: getActivitiesInStages
import android.support.test.runner.lifecycle.ActivityLifecycleMonitor; //导入依赖的package包/类
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;
}
示例4: getActivitiesInStages
import android.support.test.runner.lifecycle.ActivityLifecycleMonitor; //导入依赖的package包/类
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;
}
示例5: getCurrentActivityOnMainThread
import android.support.test.runner.lifecycle.ActivityLifecycleMonitor; //导入依赖的package包/类
private static Activity getCurrentActivityOnMainThread() {
ActivityLifecycleMonitor registry = ActivityLifecycleMonitorRegistry.getInstance();
Collection<Activity> activities = registry.getActivitiesInStage(Stage.RESUMED);
return activities.iterator().hasNext() ? activities.iterator().next() : null;
}