Share via


Instrumentation.NewActivity Method

Definition

Overloads

NewActivity(Class, Context, IBinder, Application, Intent, ActivityInfo, ICharSequence, Activity, String, Object)

Perform instantiation of an Activity object.

NewActivity(Class, Context, IBinder, Application, Intent, ActivityInfo, String, Activity, String, Object)

Perform instantiation of an Activity object.

NewActivity(ClassLoader, String, Intent)

Perform instantiation of the process's Activity object.

NewActivity(Class, Context, IBinder, Application, Intent, ActivityInfo, ICharSequence, Activity, String, Object)

Perform instantiation of an Activity object.

[Android.Runtime.Register("newActivity", "(Ljava/lang/Class;Landroid/content/Context;Landroid/os/IBinder;Landroid/app/Application;Landroid/content/Intent;Landroid/content/pm/ActivityInfo;Ljava/lang/CharSequence;Landroid/app/Activity;Ljava/lang/String;Ljava/lang/Object;)Landroid/app/Activity;", "GetNewActivity_Ljava_lang_Class_Landroid_content_Context_Landroid_os_IBinder_Landroid_app_Application_Landroid_content_Intent_Landroid_content_pm_ActivityInfo_Ljava_lang_CharSequence_Landroid_app_Activity_Ljava_lang_String_Ljava_lang_Object_Handler")]
public virtual Android.App.Activity? NewActivity (Java.Lang.Class? clazz, Android.Content.Context? context, Android.OS.IBinder? token, Android.App.Application? application, Android.Content.Intent? intent, Android.Content.PM.ActivityInfo? info, Java.Lang.ICharSequence? title, Android.App.Activity? parent, string? id, Java.Lang.Object? lastNonConfigurationInstance);
[<Android.Runtime.Register("newActivity", "(Ljava/lang/Class;Landroid/content/Context;Landroid/os/IBinder;Landroid/app/Application;Landroid/content/Intent;Landroid/content/pm/ActivityInfo;Ljava/lang/CharSequence;Landroid/app/Activity;Ljava/lang/String;Ljava/lang/Object;)Landroid/app/Activity;", "GetNewActivity_Ljava_lang_Class_Landroid_content_Context_Landroid_os_IBinder_Landroid_app_Application_Landroid_content_Intent_Landroid_content_pm_ActivityInfo_Ljava_lang_CharSequence_Landroid_app_Activity_Ljava_lang_String_Ljava_lang_Object_Handler")>]
abstract member NewActivity : Java.Lang.Class * Android.Content.Context * Android.OS.IBinder * Android.App.Application * Android.Content.Intent * Android.Content.PM.ActivityInfo * Java.Lang.ICharSequence * Android.App.Activity * string * Java.Lang.Object -> Android.App.Activity
override this.NewActivity : Java.Lang.Class * Android.Content.Context * Android.OS.IBinder * Android.App.Application * Android.Content.Intent * Android.Content.PM.ActivityInfo * Java.Lang.ICharSequence * Android.App.Activity * string * Java.Lang.Object -> Android.App.Activity

Parameters

clazz
Class

The Class of the desired Activity

context
Context

The base context for the activity to use

token
IBinder

The token for this activity to communicate with

application
Application

The application object (if any)

intent
Intent

The intent that started this Activity

info
ActivityInfo

ActivityInfo from the manifest

title
ICharSequence

The title, typically retrieved from the ActivityInfo record

parent
Activity

The parent Activity (if any)

id
String

The embedded Id (if any)

lastNonConfigurationInstance
Object

Arbitrary object that will be available via Activity#getLastNonConfigurationInstance() Activity.getLastNonConfigurationInstance().

Returns

Returns the instantiated activity

Attributes

Remarks

Perform instantiation of an Activity object. This method is intended for use with unit tests, such as android.test.ActivityUnitTestCase. The activity will be useable locally but will be missing some of the linkages necessary for use within the system.

Java documentation for android.app.Instrumentation.newActivity(java.lang.Class<?>, android.content.Context, android.os.IBinder, android.app.Application, android.content.Intent, android.content.pm.ActivityInfo, java.lang.CharSequence, android.app.Activity, java.lang.String, java.lang.Object).

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.

Applies to

NewActivity(Class, Context, IBinder, Application, Intent, ActivityInfo, String, Activity, String, Object)

Perform instantiation of an Activity object.

public Android.App.Activity? NewActivity (Java.Lang.Class? clazz, Android.Content.Context? context, Android.OS.IBinder? token, Android.App.Application? application, Android.Content.Intent? intent, Android.Content.PM.ActivityInfo? info, string? title, Android.App.Activity? parent, string? id, Java.Lang.Object? lastNonConfigurationInstance);
member this.NewActivity : Java.Lang.Class * Android.Content.Context * Android.OS.IBinder * Android.App.Application * Android.Content.Intent * Android.Content.PM.ActivityInfo * string * Android.App.Activity * string * Java.Lang.Object -> Android.App.Activity

Parameters

clazz
Class

The Class of the desired Activity

context
Context

The base context for the activity to use

token
IBinder

The token for this activity to communicate with

application
Application

The application object (if any)

intent
Intent

The intent that started this Activity

info
ActivityInfo

ActivityInfo from the manifest

title
String

The title, typically retrieved from the ActivityInfo record

parent
Activity

The parent Activity (if any)

id
String

The embedded Id (if any)

lastNonConfigurationInstance
Object

Arbitrary object that will be available via Activity#getLastNonConfigurationInstance() Activity.getLastNonConfigurationInstance().

Returns

Returns the instantiated activity

Remarks

Perform instantiation of an Activity object. This method is intended for use with unit tests, such as android.test.ActivityUnitTestCase. The activity will be useable locally but will be missing some of the linkages necessary for use within the system.

Java documentation for android.app.Instrumentation.newActivity(java.lang.Class<?>, android.content.Context, android.os.IBinder, android.app.Application, android.content.Intent, android.content.pm.ActivityInfo, java.lang.CharSequence, android.app.Activity, java.lang.String, java.lang.Object).

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.

Applies to

NewActivity(ClassLoader, String, Intent)

Perform instantiation of the process's Activity object.

[Android.Runtime.Register("newActivity", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Intent;)Landroid/app/Activity;", "GetNewActivity_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Intent_Handler")]
public virtual Android.App.Activity? NewActivity (Java.Lang.ClassLoader? cl, string? className, Android.Content.Intent? intent);
[<Android.Runtime.Register("newActivity", "(Ljava/lang/ClassLoader;Ljava/lang/String;Landroid/content/Intent;)Landroid/app/Activity;", "GetNewActivity_Ljava_lang_ClassLoader_Ljava_lang_String_Landroid_content_Intent_Handler")>]
abstract member NewActivity : Java.Lang.ClassLoader * string * Android.Content.Intent -> Android.App.Activity
override this.NewActivity : Java.Lang.ClassLoader * string * Android.Content.Intent -> Android.App.Activity

Parameters

cl
ClassLoader

The ClassLoader with which to instantiate the object.

className
String

The name of the class implementing the Activity object.

intent
Intent

The Intent object that specified the activity class being instantiated.

Returns

The newly instantiated Activity object.

Attributes

Exceptions

Remarks

Perform instantiation of the process's Activity object. The default implementation provides the normal system behavior.

Java documentation for android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent).

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.

Applies to