Language

Activity.StartActivityFromFragment Method

Definition

Overloads

Name Description
StartActivityFromFragment(Fragment, Intent, Int32)

This method was deprecated in API level 28.

StartActivityFromFragment(Fragment, Intent, Int32, Bundle)

This method was deprecated in API level 28.

StartActivityFromFragment(Fragment, Intent, Int32)

This method was deprecated in API level 28.

[Android.Runtime.Register("startActivityFromFragment", "(Landroid/app/Fragment;Landroid/content/Intent;I)V", "GetStartActivityFromFragment_Landroid_app_Fragment_Landroid_content_Intent_IHandler")]
public virtual void StartActivityFromFragment(Android.App.Fragment fragment, Android.Content.Intent? intent, int requestCode);
[<Android.Runtime.Register("startActivityFromFragment", "(Landroid/app/Fragment;Landroid/content/Intent;I)V", "GetStartActivityFromFragment_Landroid_app_Fragment_Landroid_content_Intent_IHandler")>]
abstract member StartActivityFromFragment : Android.App.Fragment * Android.Content.Intent * int -> unit
override this.StartActivityFromFragment : Android.App.Fragment * Android.Content.Intent * int -> unit

Parameters

fragment
Fragment

Fragment: The fragment making the call. This value cannot be null.

intent
Intent

Intent: The intent to start.

requestCode
Int32

int: Reply request code. < 0 if reply is not requested.

Attributes

Remarks

This method was deprecated in API level 28. Use androidx.fragment.app.FragmentActivity.startActivityFromFragment( androidx.fragment.app.Fragment,Intent,int)

Same as calling startActivityFromFragment(Fragment,Intent,int,Bundle) with no options.

See also:

Throws: android.content.ActivityNotFoundException

Android reference for android.app.Activity.startActivityFromFragment.

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

StartActivityFromFragment(Fragment, Intent, Int32, Bundle)

This method was deprecated in API level 28.

[Android.Runtime.Register("startActivityFromFragment", "(Landroid/app/Fragment;Landroid/content/Intent;ILandroid/os/Bundle;)V", "GetStartActivityFromFragment_Landroid_app_Fragment_Landroid_content_Intent_ILandroid_os_Bundle_Handler")]
public virtual void StartActivityFromFragment(Android.App.Fragment fragment, Android.Content.Intent? intent, int requestCode, Android.OS.Bundle? options);
[<Android.Runtime.Register("startActivityFromFragment", "(Landroid/app/Fragment;Landroid/content/Intent;ILandroid/os/Bundle;)V", "GetStartActivityFromFragment_Landroid_app_Fragment_Landroid_content_Intent_ILandroid_os_Bundle_Handler")>]
abstract member StartActivityFromFragment : Android.App.Fragment * Android.Content.Intent * int * Android.OS.Bundle -> unit
override this.StartActivityFromFragment : Android.App.Fragment * Android.Content.Intent * int * Android.OS.Bundle -> unit

Parameters

fragment
Fragment

Fragment: The fragment making the call. This value cannot be null.

intent
Intent

Intent: The intent to start.

requestCode
Int32

int: Reply request code. < 0 if reply is not requested.

options
Bundle

Bundle: Additional options for how the Activity should be started. See android.content.Context.startActivity(Intent,Bundle) Context.startActivity(Intent, Bundle)} for more details. This value may be null.

Attributes

Remarks

This method was deprecated in API level 28. Use androidx.fragment.app.FragmentActivity.startActivityFromFragment( androidx.fragment.app.Fragment,Intent,int,Bundle)

This is called when a Fragment in this activity calls its Fragment.startActivity or Fragment.startActivityForResult method. This method throws ActivityNotFoundException if there was no Activity found to run the given Intent.

See also:

Throws: android.content.ActivityNotFoundException

Android reference for android.app.Activity.startActivityFromFragment.

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