JSONObject.OptBoolean Method

Definition

Overloads

OptBoolean(String, Boolean)

Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or fallback otherwise.

OptBoolean(String)

Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or false otherwise.

OptBoolean(String, Boolean)

Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or fallback otherwise.

[Android.Runtime.Register("optBoolean", "(Ljava/lang/String;Z)Z", "GetOptBoolean_Ljava_lang_String_ZHandler")]
public virtual bool OptBoolean (string name, bool fallback);
abstract member OptBoolean : string * bool -> bool
override this.OptBoolean : string * bool -> bool

Parameters

name
String
fallback
Boolean

Returns

Boolean
Attributes

Remarks

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

OptBoolean(String)

Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or false otherwise.

[Android.Runtime.Register("optBoolean", "(Ljava/lang/String;)Z", "GetOptBoolean_Ljava_lang_String_Handler")]
public virtual bool OptBoolean (string name);
abstract member OptBoolean : string -> bool
override this.OptBoolean : string -> bool

Parameters

name
String

Returns

Boolean
Attributes

Remarks

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