public final class

ActivityLifecycleMonitorRegistry

extends Object
java.lang.Object
   ↳ android.support.test.runner.lifecycle.ActivityLifecycleMonitorRegistry

Class Overview

An exposed registry instance to make it easy for callers to find the lifecycle monitor for their application.

Summary

Public Methods
static ActivityLifecycleMonitor getInstance()
Returns the ActivityLifecycleMonitor.
static void registerInstance(ActivityLifecycleMonitor monitor)
Stores a lifecycle monitor in the registry.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static ActivityLifecycleMonitor getInstance ()

Returns the ActivityLifecycleMonitor. This monitor is not guaranteed to be present under all instrumentations.

Returns
  • ActivityLifecycleMonitor the monitor for this application.
Throws
IllegalStateException if no monitor has been registered.

public static void registerInstance (ActivityLifecycleMonitor monitor)

Stores a lifecycle monitor in the registry.

This is a global registry - so be aware of the impact of calling this method!

Parameters
monitor the monitor for this application. Null deregisters any existing monitor.