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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -