AppComponentFactory
@RequiresApi(value = 28)
class AppComponentFactory : AppComponentFactory
Version of android.app.AppComponentFactory that works with androidx libraries. Note: This will only work on API 28+ and does not backport AppComponentFactory functionality.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
Activity |
instantiateActivity(cl: ClassLoader, className: String, intent: Intent?) |
Activity |
instantiateActivityCompat(Allows application to override the creation of activities. |
Application |
instantiateApplication(cl: ClassLoader, className: String) |
Application |
instantiateApplicationCompat(cl: ClassLoader, className: String)Allows application to override the creation of the application object. |
ContentProvider |
instantiateProvider(cl: ClassLoader, className: String) |
ContentProvider |
instantiateProviderCompat(cl: ClassLoader, className: String)Allows application to override the creation of providers. |
BroadcastReceiver |
instantiateReceiver(cl: ClassLoader, className: String, intent: Intent?) |
BroadcastReceiver |
instantiateReceiverCompat(Allows application to override the creation of receivers. |
Service |
instantiateService(cl: ClassLoader, className: String, intent: Intent?) |
Service |
instantiateServiceCompat(Allows application to override the creation of services. |
Inherited functions |
||
|---|---|---|
|
Public constructors
Public functions
instantiateActivity
fun instantiateActivity(cl: ClassLoader, className: String, intent: Intent?): Activity
| Throws | |
|---|---|
java.lang.InstantiationException |
|
java.lang.IllegalAccessException |
|
java.lang.ClassNotFoundException |
| See also | |
|---|---|
instantiateActivityCompat |
instantiateActivityCompat
fun instantiateActivityCompat(
cl: ClassLoader,
className: String,
intent: Intent?
): Activity
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. |
instantiateApplication
fun instantiateApplication(cl: ClassLoader, className: String): Application
| Throws | |
|---|---|
java.lang.InstantiationException |
|
java.lang.IllegalAccessException |
|
java.lang.ClassNotFoundException |
| See also | |
|---|---|
instantiateApplicationCompat |
instantiateApplicationCompat
fun instantiateApplicationCompat(cl: ClassLoader, className: String): Application
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. |
instantiateProvider
fun instantiateProvider(cl: ClassLoader, className: String): ContentProvider
| Throws | |
|---|---|
java.lang.InstantiationException |
|
java.lang.IllegalAccessException |
|
java.lang.ClassNotFoundException |
| See also | |
|---|---|
instantiateProviderCompat |
instantiateProviderCompat
fun instantiateProviderCompat(cl: ClassLoader, className: String): ContentProvider
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. |
instantiateReceiver
fun instantiateReceiver(cl: ClassLoader, className: String, intent: Intent?): BroadcastReceiver
| Throws | |
|---|---|
java.lang.InstantiationException |
|
java.lang.IllegalAccessException |
|
java.lang.ClassNotFoundException |
| See also | |
|---|---|
instantiateReceiverCompat |
instantiateReceiverCompat
fun instantiateReceiverCompat(
cl: ClassLoader,
className: String,
intent: Intent?
): BroadcastReceiver
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. |
instantiateService
fun instantiateService(cl: ClassLoader, className: String, intent: Intent?): Service
| Throws | |
|---|---|
java.lang.InstantiationException |
|
java.lang.IllegalAccessException |
|
java.lang.ClassNotFoundException |
| See also | |
|---|---|
instantiateServiceCompat |
instantiateServiceCompat
fun instantiateServiceCompat(
cl: ClassLoader,
className: String,
intent: Intent?
): Service
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. |