Sdílet prostřednictvím


JSONArray.OptBoolean Method

Definition

Overloads

OptBoolean(Int32)

Returns the value at index if it exists and is a boolean or can be coerced to a boolean.

OptBoolean(Int32, Boolean)

Returns the value at index if it exists and is a boolean or can be coerced to a boolean.

OptBoolean(Int32)

Returns the value at index if it exists and is a boolean or can be coerced to a boolean.

[Android.Runtime.Register("optBoolean", "(I)Z", "GetOptBoolean_IHandler")]
public virtual bool OptBoolean (int index);
[<Android.Runtime.Register("optBoolean", "(I)Z", "GetOptBoolean_IHandler")>]
abstract member OptBoolean : int -> bool
override this.OptBoolean : int -> bool

Parameters

index
Int32

Returns

Attributes

Remarks

Returns the value at index if it exists and is a boolean or can be coerced to a boolean. Returns false otherwise.

Java documentation for org.json.JSONArray.optBoolean(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

OptBoolean(Int32, Boolean)

Returns the value at index if it exists and is a boolean or can be coerced to a boolean.

[Android.Runtime.Register("optBoolean", "(IZ)Z", "GetOptBoolean_IZHandler")]
public virtual bool OptBoolean (int index, bool fallback);
[<Android.Runtime.Register("optBoolean", "(IZ)Z", "GetOptBoolean_IZHandler")>]
abstract member OptBoolean : int * bool -> bool
override this.OptBoolean : int * bool -> bool

Parameters

index
Int32
fallback
Boolean

Returns

Attributes

Remarks

Returns the value at index if it exists and is a boolean or can be coerced to a boolean. Returns fallback otherwise.

Java documentation for org.json.JSONArray.optBoolean(int, 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