AppComponentFactory.InstantiateReceiver(ClassLoader, String, Intent) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allows application to override the creation of receivers.
[Android.Runtime.Register("instantiateReceiver", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Intent;)Landroid/content/BroadcastReceiver;", "GetInstantiateReceiver_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Intent_Handler", ApiSince=28)]
public virtual Android.Content.BroadcastReceiver InstantiateReceiver(Java.Lang.ClassLoader cl, string className, Android.Content.Intent? intent);
[<Android.Runtime.Register("instantiateReceiver", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Intent;)Landroid/content/BroadcastReceiver;", "GetInstantiateReceiver_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Intent_Handler", ApiSince=28)>]
abstract member InstantiateReceiver : Java.Lang.ClassLoader * string * Android.Content.Intent -> Android.Content.BroadcastReceiver
override this.InstantiateReceiver : Java.Lang.ClassLoader * string * Android.Content.Intent -> Android.Content.BroadcastReceiver
Parameters
- cl
- ClassLoader
The default classloader to use for instantiation.
- className
- String
The class to be instantiated.
- intent
- Intent
Intent creating the class.
Returns
This value cannot be null.
- Attributes
Remarks
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.
Throws: ClassNotFoundException
Throws: IllegalAccessException
Throws: InstantiationException
Android reference for android.app.AppComponentFactory.instantiateReceiver.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.