AppComponentFactory
public
class
AppComponentFactory
extends 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 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 |
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
AppComponentFactory
public AppComponentFactory ()
Public methods
instantiateActivity
public final Activity instantiateActivity (ClassLoader cl,
String className,
Intent intent)
Parameters |
cl |
ClassLoader |
className |
String |
intent |
Intent |
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateActivityCompat
public 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.
|
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateApplication
public final Application instantiateApplication (ClassLoader cl,
String className)
Parameters |
cl |
ClassLoader |
className |
String |
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateApplicationCompat
public 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.
|
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateProvider
public final ContentProvider instantiateProvider (ClassLoader cl,
String className)
Parameters |
cl |
ClassLoader |
className |
String |
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateProviderCompat
public 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.
|
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateReceiver
public final BroadcastReceiver instantiateReceiver (ClassLoader cl,
String className,
Intent intent)
Parameters |
cl |
ClassLoader |
className |
String |
intent |
Intent |
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateReceiverCompat
public 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.
|
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateService
public final Service instantiateService (ClassLoader cl,
String className,
Intent intent)
Parameters |
cl |
ClassLoader |
className |
String |
intent |
Intent |
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|
instantiateServiceCompat
public 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.
|
Throws |
InstantiationException |
|
IllegalAccessException |
|
ClassNotFoundException |
|