Google is committed to advancing racial equity for Black communities. See how.

AppInitializer

public final class AppInitializer
extends Object

java.lang.Object
   ↳ androidx.startup.AppInitializer


An AppInitializer can be used to initialize all discovered [ComponentInitializer]s.
The discovery mechanism is via `` entries in the merged `AndroidManifest.xml`.

Summary

Public methods

static AppInitializer getInstance(Context context)
<T> T initializeComponent(Class<? extends Initializer<T>> component)

Initializes a Initializer class type.

boolean isEagerlyInitialized(Class<? extends Initializer<?>> component)

Returns true if the Initializer was eagerly initialized..

Inherited methods

Public methods

getInstance

public static AppInitializer getInstance (Context context)

Parameters
context Context: The Application Context

Returns
AppInitializer The instance of AppInitializer after initialization.

initializeComponent

public T initializeComponent (Class<? extends Initializer<T>> component)

Initializes a Initializer class type.

Parameters
component Class: The Class of Initializer to initialize.

Returns
T The initialized instance

isEagerlyInitialized

public boolean isEagerlyInitialized (Class<? extends Initializer<?>> component)

Returns true if the Initializer was eagerly initialized..

Parameters
component Class: The Initializer class to check

Returns
boolean true if the Initializer was eagerly initialized.