Sdílet prostřednictvím


Resources.GetBoolean(Int32) Method

Definition

Return a boolean associated with a particular resource ID.

[Android.Runtime.Register("getBoolean", "(I)Z", "GetGetBoolean_IHandler")]
public virtual bool GetBoolean (int id);
[<Android.Runtime.Register("getBoolean", "(I)Z", "GetGetBoolean_IHandler")>]
abstract member GetBoolean : int -> bool
override this.GetBoolean : int -> bool

Parameters

id
Int32

The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.

Returns

Returns the boolean value contained in the resource.

Attributes

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Return a boolean associated with a particular resource ID. This can be used with any integral resource value, and will return true if it is non-zero.

Java documentation for android.content.res.Resources.getBoolean(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