共用方式為


Field.SetBoolean(Object, Boolean) Method

Definition

Sets the value of a field as a boolean on the specified object.

[Android.Runtime.Register("setBoolean", "(Ljava/lang/Object;Z)V", "")]
public void SetBoolean (Java.Lang.Object? obj, bool z);
[<Android.Runtime.Register("setBoolean", "(Ljava/lang/Object;Z)V", "")>]
member this.SetBoolean : Java.Lang.Object * bool -> unit

Parameters

obj
Object

the object whose field should be modified

z
Boolean

the new value for the field of obj being modified

Attributes

Exceptions

if the object is null and the field is non-static

if the object is not compatible with the declaring class

if this field is not accessible

Remarks

Sets the value of a field as a boolean on the specified object. This method is equivalent to set(obj, zObj), where zObj is a Boolean object and zObj.booleanValue() == z.

Java documentation for java.lang.reflect.Field.setBoolean(java.lang.Object, boolean).

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