Udostępnij za pośrednictwem


Activity.StartActivityFromFragment Method

Definition

Overloads

StartActivityFromFragment(Fragment, Intent, Int32)

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

StartActivityFromFragment(Fragment, Intent, Int32, Bundle)

This is called when a Fragment in this activity calls its Fragment#startActivity or Fragment#startActivityForResult method.

StartActivityFromFragment(Fragment, Intent, Int32)

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

[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

The fragment making the call.

intent
Intent

The intent to start.

requestCode
Int32

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

Attributes

Exceptions

Remarks

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

This member is deprecated. Use androidx.fragment.app.FragmentActivity#startActivityFromFragment( androidx.fragment.app.Fragment,Intent,int)

Java documentation for android.app.Activity.startActivityFromFragment(android.app.Fragment, android.content.Intent, int).

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.App.Fragment.StartActivityForResult(Android.Content.Intent%2c+System.Int32)>

Applies to

StartActivityFromFragment(Fragment, Intent, Int32, Bundle)

This is called when a Fragment in this activity calls its Fragment#startActivity or Fragment#startActivityForResult method.

[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

The fragment making the call.

intent
Intent

The intent to start.

requestCode
Int32

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

options
Bundle

Additional options for how the Activity should be started. See android.content.Context#startActivity(Intent, Bundle) Context.startActivity(Intent, Bundle)} for more details.

Attributes

Exceptions

Remarks

This is called when a Fragment in this activity calls its Fragment#startActivity or Fragment#startActivityForResult method.

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

This member is deprecated. Use androidx.fragment.app.FragmentActivity#startActivityFromFragment( androidx.fragment.app.Fragment,Intent,int,Bundle)

Java documentation for android.app.Activity.startActivityFromFragment(android.app.Fragment, android.content.Intent, int, 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.App.Fragment.StartActivityForResult(Android.Content.Intent%2c+System.Int32)>

Applies to