Java.Lang.Reflect.Field.SetBoolean Method
Sets the value of the field in the specified object to the boolean value.

Syntax

[Android.Runtime.Register("setBoolean", "(Ljava/lang/Object;Z)V", "")]
public void SetBoolean (Java.Lang.Object object, bool value)

Parameters

object
the object to access
value
the new value

Exceptions

TypeReason
Java.Lang.NullPointerExceptionif the object is null and the field is non-static
Java.Lang.IllegalArgumentExceptionif the object is not compatible with the declaring class
Java.Lang.IllegalAccessExceptionif this field is not accessible

Remarks

Sets the value of the field in the specified object to the boolean value. This reproduces the effect of object.fieldName = value

If this field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.

If this Field object is enforcing access control (see AccessibleObject) and this field is not accessible from the current context, an IllegalAccessException is thrown.

If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.

[Android Documentation]

Requirements

Namespace: Java.Lang.Reflect
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1