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

AppInitializer

class AppInitializer
kotlin.Any
   ↳ 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(@NonNull context: Context)

T
initializeComponent(@NonNull component: Class<out Initializer<T>!>)

Initializes a Initializer class type.

Boolean
isEagerlyInitialized(@NonNull component: Class<out Initializer<*>!>)

Returns true if the Initializer was eagerly initialized.

Public methods

getInstance

@NonNull static fun getInstance(@NonNull context: Context): AppInitializer
Parameters
context Context: The Application Context
Return
AppInitializer The instance of AppInitializer after initialization.

initializeComponent

@NonNull fun <T : Any!> initializeComponent(@NonNull component: Class<out Initializer<T>!>): T

Initializes a Initializer class type.

Parameters
component Class<out Initializer<T>!>: The Class of Initializer to initialize.
<T> The instance type being initialized
Return
T The initialized instance

isEagerlyInitialized

fun isEagerlyInitialized(@NonNull component: Class<out Initializer<*>!>): Boolean

Returns true if the Initializer was eagerly initialized..

Parameters
component Class<out Initializer<*>!>: The Initializer class to check
Return
Boolean true if the Initializer was eagerly initialized.