FragmentTransaction.Replace Method

Definition

Overloads

Replace(Int32, Fragment)

Calls #replace(int, Fragment, String) with a null tag.

Replace(Int32, Fragment, String)

Replace an existing fragment that was added to a container.

Replace(Int32, Fragment)

Calls #replace(int, Fragment, String) with a null tag.

[Android.Runtime.Register("replace", "(ILandroid/app/Fragment;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Handler")]
public abstract Android.App.FragmentTransaction? Replace (int containerViewId, Android.App.Fragment? fragment);
[<Android.Runtime.Register("replace", "(ILandroid/app/Fragment;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Handler")>]
abstract member Replace : int * Android.App.Fragment -> Android.App.FragmentTransaction

Parameters

containerViewId
Int32
fragment
Fragment

Returns

FragmentTransaction
Attributes

Remarks

Java documentation for android.app.FragmentTransaction.replace(int, android.app.Fragment).

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

Replace(Int32, Fragment, String)

Replace an existing fragment that was added to a container.

[Android.Runtime.Register("replace", "(ILandroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Ljava_lang_String_Handler")]
public abstract Android.App.FragmentTransaction? Replace (int containerViewId, Android.App.Fragment? fragment, string? tag);
[<Android.Runtime.Register("replace", "(ILandroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Ljava_lang_String_Handler")>]
abstract member Replace : int * Android.App.Fragment * string -> Android.App.FragmentTransaction

Parameters

containerViewId
Int32

Identifier of the container whose fragment(s) are to be replaced.

fragment
Fragment

The new fragment to place in the container.

tag
String

Optional tag name for the fragment, to later retrieve the fragment with FragmentManager#findFragmentByTag(String) FragmentManager.findFragmentByTag(String).

Returns

FragmentTransaction

Returns the same FragmentTransaction instance.

Attributes

Remarks

Java documentation for android.app.FragmentTransaction.replace(int, android.app.Fragment, java.lang.String).

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