I have a recyclerview that has a checkbox in its row, after I check in each item I add it to a `SparseBooleanArray`, this let me store the position of the checked item and the value `(true or false)` , now , after I do this I iterate inside this BooleanArray to get each item that has been checked (true) , but now I want to know how do I know that all items has been checked, this code just brings up element by element and knows which one is true or not, but I need to know whenever all items are checked or not.

```
class MyAdapter() {

val map = SparseBooleanArray()

 fun getCheckedArray():SparseBooleanArray = map
 fun getCart(): MutableList<Cart> = cartList

 inner class OrdersInnerViewHolder(itemView: View): BaseViewHolder<Cart>(itemView){
        override fun bind(item: Cart, position: Int) {

            itemView.checkBox.isChecked = item.isChecked

            itemView.checkBox.setOnCheckedChangeListener { buttonView, isChecked ->
                item.isChecked = isChecked
                if(isChecked){
                 map.put(position,true)
                }else{
                    map.removeAt(position)
                }
            }
        }
    }

```

Then I just get this sparsearray and I check for each entry if its true (which will be since it only stores true values only, but I need to know if all the values of that list has been checked to continue)

```
  for((index, item) in myAdapter.getCart().withIndex()){
                    if(myAdapter.getCheckedArray().get(index)){
                      //Here I will get elements that are true, I need to know if all elements has been checked
                    }
                }

```