Window.RequireViewById(Int32) Method

Definition

Finds a view that was identified by the android:id XML attribute that was processed in android.app.Activity#onCreate, or throws an IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.

[Android.Runtime.Register("requireViewById", "(I)Landroid/view/View;", "", ApiSince=28)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.view.View" })]
public Java.Lang.Object RequireViewById (int id);
[<Android.Runtime.Register("requireViewById", "(I)Landroid/view/View;", "", ApiSince=28)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.view.View" })>]
member this.RequireViewById : int -> Java.Lang.Object

Parameters

id
Int32

the ID to search for

Returns

Object

a view with given ID

Attributes

Remarks

Java documentation for android.view.Window.requireViewById(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