Freigeben über


Context.StartActivity Method

Definition

Overloads

StartActivity(Intent)

Same as #startActivity(Intent, Bundle) with no options specified.

StartActivity(Type)
StartActivity(Intent, Bundle)

Launch a new activity.

StartActivity(Intent)

Same as #startActivity(Intent, Bundle) with no options specified.

[Android.Runtime.Register("startActivity", "(Landroid/content/Intent;)V", "GetStartActivity_Landroid_content_Intent_Handler")]
public abstract void StartActivity (Android.Content.Intent? intent);
[<Android.Runtime.Register("startActivity", "(Landroid/content/Intent;)V", "GetStartActivity_Landroid_content_Intent_Handler")>]
abstract member StartActivity : Android.Content.Intent -> unit

Parameters

intent
Intent

The description of the activity to start.

Attributes

Exceptions

Remarks

Same as #startActivity(Intent, Bundle) with no options specified.

Java documentation for android.content.Context.startActivity(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.

See also

  • <xref:Android.Content.Context.StartActivity(Android.Content.Intent%2c+Android.OS.Bundle)>
  • <xref:Android.Content.PM.PackageManager.ResolveActivity(Android.Content.Intent%2c+Android.Content.PM.PackageInfoFlags)>

Applies to

StartActivity(Type)

public void StartActivity (Type type);
member this.StartActivity : Type -> unit

Parameters

type
Type

Remarks

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

StartActivity(Intent, Bundle)

Launch a new activity.

[Android.Runtime.Register("startActivity", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetStartActivity_Landroid_content_Intent_Landroid_os_Bundle_Handler")]
public abstract void StartActivity (Android.Content.Intent? intent, Android.OS.Bundle? options);
[<Android.Runtime.Register("startActivity", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetStartActivity_Landroid_content_Intent_Landroid_os_Bundle_Handler")>]
abstract member StartActivity : Android.Content.Intent * Android.OS.Bundle -> unit

Parameters

intent
Intent

The description of the activity to start.

options
Bundle

Additional options for how the Activity should be started. May be null if there are no options. See android.app.ActivityOptions for how to build the Bundle supplied here; there are no supported definitions for building it manually.

Attributes

Exceptions

Remarks

Launch a new activity. You will not receive any information about when the activity exits.

Note that if this method is being called from outside of an android.app.Activity Context, then the Intent must include the Intent#FLAG_ACTIVITY_NEW_TASK launch flag. This is because, without being started from an existing Activity, there is no existing task in which to place the new activity and thus it needs to be placed in its own separate task.

This method throws ActivityNotFoundException if there was no Activity found to run the given Intent.

Java documentation for android.content.Context.startActivity(android.content.Intent, android.os.Bundle).

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.

See also

  • StartActivity(Intent)
  • <xref:Android.Content.PM.PackageManager.ResolveActivity(Android.Content.Intent%2c+Android.Content.PM.PackageInfoFlags)>

Applies to