belongs to Maven artifact androidx.core:core:1.0.0-alpha1

AppComponentFactory

public class AppComponentFactory
extends AppComponentFactory

java.lang.Object
   ↳ android.app.AppComponentFactory
     ↳ androidx.core.app.AppComponentFactory


Version of AppComponentFactory that works with androidx libraries. Note: This will only work on API 28+ and does not backport AppComponentFactory functionality.

Summary

Public constructors

AppComponentFactory()

Public methods

final Activity instantiateActivity(ClassLoader cl, String className, Intent intent)
Activity instantiateActivityCompat(ClassLoader cl, String className, Intent intent)

Allows application to override the creation of activities.

final Application instantiateApplication(ClassLoader cl, String className)
Application instantiateApplicationCompat(ClassLoader cl, String className)

Allows application to override the creation of the application object.

final ContentProvider instantiateProvider(ClassLoader cl, String className)
ContentProvider instantiateProviderCompat(ClassLoader cl, String className)

Allows application to override the creation of providers.

final BroadcastReceiver instantiateReceiver(ClassLoader cl, String className, Intent intent)
BroadcastReceiver instantiateReceiverCompat(ClassLoader cl, String className, Intent intent)

Allows application to override the creation of receivers.

final Service instantiateService(ClassLoader cl, String className, Intent intent)
Service instantiateServiceCompat(ClassLoader cl, String className, Intent intent)

Allows application to override the creation of services.

Inherited methods

Public constructors

AppComponentFactory

AppComponentFactory ()

Public methods

instantiateActivity

Activity instantiateActivity (ClassLoader cl, 
                String className, 
                Intent intent)

Parameters
cl ClassLoader

className String

intent Intent

Returns
Activity

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateActivityCompat

Activity instantiateActivityCompat (ClassLoader cl, 
                String className, 
                Intent intent)

Allows application to override the creation of activities. This can be used to perform things such as dependency injection or class loader changes to these classes.

This method is only intended to provide a hook for instantiation. It does not provide earlier access to the Activity object. The returned object will not be initialized as a Context yet and should not be used to interact with other android APIs.

Parameters
cl ClassLoader: The default classloader to use for instantiation.

className String: The class to be instantiated.

intent Intent: Intent creating the class.

Returns
Activity

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateApplication

Application instantiateApplication (ClassLoader cl, 
                String className)

Parameters
cl ClassLoader

className String

Returns
Application

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateApplicationCompat

Application instantiateApplicationCompat (ClassLoader cl, 
                String className)

Allows application to override the creation of the application object. This can be used to perform things such as dependency injection or class loader changes to these classes.

This method is only intended to provide a hook for instantiation. It does not provide earlier access to the Application object. The returned object will not be initialized as a Context yet and should not be used to interact with other android APIs.

Parameters
cl ClassLoader: The default classloader to use for instantiation.

className String: The class to be instantiated.

Returns
Application

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateProvider

ContentProvider instantiateProvider (ClassLoader cl, 
                String className)

Parameters
cl ClassLoader

className String

Returns
ContentProvider

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateProviderCompat

ContentProvider instantiateProviderCompat (ClassLoader cl, 
                String className)

Allows application to override the creation of providers. This can be used to perform things such as dependency injection or class loader changes to these classes.

This method is only intended to provide a hook for instantiation. It does not provide earlier access to the ContentProvider object. The returned object will not be initialized with a Context yet and should not be used to interact with other android APIs.

Parameters
cl ClassLoader: The default classloader to use for instantiation.

className String: The class to be instantiated.

Returns
ContentProvider

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateReceiver

BroadcastReceiver instantiateReceiver (ClassLoader cl, 
                String className, 
                Intent intent)

Parameters
cl ClassLoader

className String

intent Intent

Returns
BroadcastReceiver

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateReceiverCompat

BroadcastReceiver instantiateReceiverCompat (ClassLoader cl, 
                String className, 
                Intent intent)

Allows application to override the creation of receivers. This can be used to perform things such as dependency injection or class loader changes to these classes.

Parameters
cl ClassLoader: The default classloader to use for instantiation.

className String: The class to be instantiated.

intent Intent: Intent creating the class.

Returns
BroadcastReceiver

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateService

Service instantiateService (ClassLoader cl, 
                String className, 
                Intent intent)

Parameters
cl ClassLoader

className String

intent Intent

Returns
Service

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException

instantiateServiceCompat

Service instantiateServiceCompat (ClassLoader cl, 
                String className, 
                Intent intent)

Allows application to override the creation of services. This can be used to perform things such as dependency injection or class loader changes to these classes.

This method is only intended to provide a hook for instantiation. It does not provide earlier access to the Service object. The returned object will not be initialized as a Context yet and should not be used to interact with other android APIs.

Parameters
cl ClassLoader: The default classloader to use for instantiation.

className String: The class to be instantiated.

intent Intent: Intent creating the class.

Returns
Service

Throws
InstantiationException
IllegalAccessException
ClassNotFoundException