java - check if there is at least a single true value in SparseBooleanArray -
i'm creating android app listview
, i'm using line:
sparsebooleanarray checkedpositions = list.getcheckeditempositions();
then want iterate on array if there @ least single value true in checkedpositions
array.
can done?
you cannot that. create method you.
public boolean containstruevalue(sparsebooleanarray sparsebooleanarray) { boolean containsboolean = false; (int = 0; < sparsebooleanarray.size(); i++) { if (sparsebooleanarray.valueat(i) == true) { containsboolean = true; break; } } return containsboolean; }
Comments
Post a Comment