Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

ActivityLifecycleMonitorRegistry

public final class ActivityLifecycleMonitorRegistry
extends Object

java.lang.Object
   ↳ androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry


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.

Inherited methods

From class java.lang.Object

Public methods

getInstance

ActivityLifecycleMonitor getInstance ()

Returns the ActivityLifecycleMonitor.

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

Returns
ActivityLifecycleMonitor ActivityLifecycleMonitor the monitor for this application.

Throws
IllegalStateException if no monitor has been registered.

registerInstance

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 ActivityLifecycleMonitor: the monitor for this application. Null deregisters any existing monitor.