AppComponentFactory
@RequiresApi(28) open class AppComponentFactory : AppComponentFactory
kotlin.Any | ||
↳ | android.app.AppComponentFactory | |
↳ | androidx.core.app.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 | |
---|---|
<init>() Version of |
Public methods | |
---|---|
Activity |
instantiateActivity(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) |
open Activity |
instantiateActivityCompat(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) Allows application to override the creation of activities. |
Application |
instantiateApplication(@NonNull cl: ClassLoader, @NonNull className: String) |
open Application |
instantiateApplicationCompat(@NonNull cl: ClassLoader, @NonNull className: String) Allows application to override the creation of the application object. |
ContentProvider |
instantiateProvider(@NonNull cl: ClassLoader, @NonNull className: String) |
open ContentProvider |
instantiateProviderCompat(@NonNull cl: ClassLoader, @NonNull className: String) Allows application to override the creation of providers. |
BroadcastReceiver |
instantiateReceiver(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) |
open BroadcastReceiver |
instantiateReceiverCompat(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) Allows application to override the creation of receivers. |
Service |
instantiateService(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) |
open Service |
instantiateServiceCompat(@NonNull cl: ClassLoader, @NonNull className: String, @Nullable intent: Intent?) Allows application to override the creation of services. |
Public constructors
<init>
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.
Public methods
instantiateActivity
@NonNull fun instantiateActivity(
@NonNull cl: ClassLoader,
@NonNull className: String,
@Nullable intent: Intent?
): Activity
See Also
instantiateActivityCompat
@NonNull open fun instantiateActivityCompat(
@NonNull cl: ClassLoader,
@NonNull className: String,
@Nullable 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
@NonNull fun instantiateApplication(
@NonNull