Language

FragmentManager.FindFragmentByTag Method

Definition

Overloads

Name Description
FindFragmentByTag(String)

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

FindFragmentByTag<T>(String)

Finds a Fragment that was identified by the given tag, either when inflated from XML or as supplied when added in a transaction, and returns it cast to T.

FindFragmentByTag(String)

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

[Android.Runtime.Register("findFragmentByTag", "(Ljava/lang/String;)Landroid/app/Fragment;", "GetFindFragmentByTag_Ljava_lang_String_Handler")]
public abstract Android.App.Fragment? FindFragmentByTag(string? tag);
[<Android.Runtime.Register("findFragmentByTag", "(Ljava/lang/String;)Landroid/app/Fragment;", "GetFindFragmentByTag_Ljava_lang_String_Handler")>]
abstract member FindFragmentByTag : string -> Android.App.Fragment

Parameters

tag
String

String

Returns

The fragment if found or null otherwise.

Attributes

Remarks

Finds a fragment that was identified by the given tag either when inflated from XML or as supplied 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 are searched.

Android reference for android.app.FragmentManager.findFragmentByTag.

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

FindFragmentByTag<T>(String)

Finds a Fragment that was identified by the given tag, either when inflated from XML or as supplied when added in a transaction, and returns it cast to T.

public T? FindFragmentByTag<T>(string tag) where T : Android.App.Fragment;
member this.FindFragmentByTag : string -> 'T (requires 'T :> Android.App.Fragment)

Type Parameters

T

The Fragment type to cast the result to.

Parameters

tag
String

The tag used to identify the fragment.

Returns

T

The matching fragment cast to T, or null if no matching fragment exists.

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