Language

Dialog.FindViewById Method

Definition

Overloads

Name Description
FindViewById(Int32)

Finds the first view with the given ID in the dialog's window, or null if no view matches.

FindViewById<T>(Int32)

Finds a view by resource ID and casts the result to the requested view type.

FindViewById(Int32)

Finds the first view with the given ID in the dialog's window, or null if no view matches.

[Android.Runtime.Register("findViewById", "(I)Landroid/view/View;", "GetFindViewById_IHandler")]
public virtual Android.Views.View? FindViewById(int id);
[<Android.Runtime.Register("findViewById", "(I)Landroid/view/View;", "GetFindViewById_IHandler")>]
abstract member FindViewById : int -> Android.Views.View
override this.FindViewById : int -> Android.Views.View

Parameters

id
Int32

the ID to search for

Returns

a view with given ID if found, or null otherwise

Attributes

Remarks

The lookup searches the dialog window's view hierarchy. Use FindViewById<T>(Int32) to find a view and cast it to a managed view type.

Android reference for android.app.Dialog.findViewById.

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

FindViewById<T>(Int32)

Finds a view by resource ID and casts the result to the requested view type.

public T? FindViewById<T>(int id) where T : Android.Views.View;
member this.FindViewById : int -> 'T (requires 'T :> Android.Views.View)

Type Parameters

T

The view type to which the lookup result is cast.

Parameters

id
Int32

The resource ID forwarded to the non-generic view lookup.

Returns

T

The view returned by the non-generic lookup, cast to T.

Remarks

This overload calls FindViewById(Int32) and casts the result to T.

Applies to