次の方法で共有


DreamService.FindViewById(Int32) Method

Definition

Finds a view that was identified by the id attribute from the XML that was processed in #onCreate.

[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

The view if found or null otherwise.

Attributes

Remarks

Finds a view that was identified by the id attribute from the XML that was processed in #onCreate.

Note: Requires a window, do not call before #onAttachedToWindow()

<strong>Note:</strong> In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary.

Java documentation for android.service.dreams.DreamService.findViewById(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