Share via


FragmentManager.FindFragmentById Method

Definition

Overloads

FindFragmentById(Int32)

Finds a fragment that was identified by the given id either when inflated from XML or as the container ID when added in a transaction.

FindFragmentById<T>(Int32)

FindFragmentById(Int32)

Finds a fragment that was identified by the given id either when inflated from XML or as the container ID when added in a transaction.

[Android.Runtime.Register("findFragmentById", "(I)Landroid/app/Fragment;", "GetFindFragmentById_IHandler")]
public abstract Android.App.Fragment? FindFragmentById (int id);
[<Android.Runtime.Register("findFragmentById", "(I)Landroid/app/Fragment;", "GetFindFragmentById_IHandler")>]
abstract member FindFragmentById : int -> Android.App.Fragment

Parameters

id
Int32

Returns

The fragment if found or null otherwise.

Attributes

Remarks

Finds a fragment that was identified by the given id either when inflated from XML or as the container ID when added in a transaction. This first searches through fragments that are currently added to the manager's activity; if no such fragment is found, then all fragments currently on the back stack associated with this ID are searched.

Java documentation for android.app.FragmentManager.findFragmentById(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.

Applies to

FindFragmentById<T>(Int32)

public T? FindFragmentById<T> (int id) where T : Android.App.Fragment;
member this.FindFragmentById : int -> 'T (requires 'T :> Android.App.Fragment)

Type Parameters

T

Parameters

id
Int32

Returns

T

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