语言

Instrumentation.NewApplication 方法

定义

重载

名称 说明
NewApplication(Class, Context)

执行进程的 Application 对象的实例化。

NewApplication(ClassLoader, String, Context)

执行进程的 Application 对象的实例化。

NewApplication(Class, Context)

执行进程的 Application 对象的实例化。

[Android.Runtime.Register("newApplication", "(Ljava/lang/Class;Landroid/content/Context;)Landroid/app/Application;", "")]
public static Android.App.Application? NewApplication(Java.Lang.Class? clazz, Android.Content.Context? context);
[<Android.Runtime.Register("newApplication", "(Ljava/lang/Class;Landroid/content/Context;)Landroid/app/Application;", "")>]
static member NewApplication : Java.Lang.Class * Android.Content.Context -> Android.App.Application

参数

clazz
Class

用于从中创建 Application 对象的类。

context
Context

用于使用 初始化应用程序的上下文

返回

新实例化的应用程序对象。

特性

注解

执行进程的 Application 对象的实例化。 默认实现提供正常的系统行为。

Throws:ClassNotFoundException

引发:IllegalAccessException

引发:InstantiationException

Android 参考。android.app.Instrumentation.newApplication

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

NewApplication(ClassLoader, String, Context)

执行进程的 Application 对象的实例化。

[Android.Runtime.Register("newApplication", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Context;)Landroid/app/Application;", "GetNewApplication_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Context_Handler")]
public virtual Android.App.Application? NewApplication(Java.Lang.ClassLoader? cl, string? className, Android.Content.Context? context);
[<Android.Runtime.Register("newApplication", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Context;)Landroid/app/Application;", "GetNewApplication_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Context_Handler")>]
abstract member NewApplication : Java.Lang.ClassLoader * string * Android.Content.Context -> Android.App.Application
override this.NewApplication : Java.Lang.ClassLoader * string * Android.Content.Context -> Android.App.Application

参数

cl
ClassLoader

用于实例化对象的 ClassLoader。

className
String

实现 Application 对象的类的名称。

context
Context

用于使用 初始化应用程序的上下文

返回

新实例化的应用程序对象。

特性

注解

执行进程的 Application 对象的实例化。 默认实现提供正常的系统行为。

Throws:ClassNotFoundException

引发:IllegalAccessException

引发:InstantiationException

Android 参考。android.app.Instrumentation.newApplication

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于