Language

FragmentHostCallback.OnStartActivityFromFragment Method

Definition

Starts a new Activity from the given fragment.

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

Parameters

fragment
Fragment

Fragment

intent
Intent

Intent

requestCode
Int32

int

options
Bundle

Bundle

Attributes

Exceptions

The default implementation receives a requestCode other than -1.

Remarks

Starts an activity on behalf of the fragment. The default implementation requires requestCode to be -1, starts the activity from the host context, and does not use options. Override this method to support a request code or options.

Android reference for android.app.FragmentHostCallback.onStartActivityFromFragment.

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