CheckedListView sparse boolean array

by raqz » Thu, 22 Apr 2010 08:03:53 GMT


Sponsored Links
 Hi,

I am trying to use the
android.R.layout.simple_list_item_multiple_choice, with
CHOICE_MODE_MULTIPLE.
The contents are being displayed all right. Even if I happen to select
the items starting from the first item then it works fine. But if in
case, I select the last item ONLY, the program doesnt store the name
in the array selected.
SparseBooleanArray positions;
positions = listView.getCheckedItemPositions();

                int j =0;
                selected = new String[size];

                for(int k =0; k < positions.size();k++){
                    if(positions.get(k)){
                        selected[j++]=items[k];
                    }

                }


Please let me know..
Thanks
Raqeeb

--



CheckedListView sparse boolean array

by raqz » Thu, 22 Apr 2010 10:03:13 GMT


 I got the answer for that, we need to increment the for loop till the
end of the list that was displayed.
the right code would be
SparseBooleanArray positions;



>


Sponsored Links


Other Threads

1. WTT: 1 Unit Galaxy Tab *mint cond dengan 12 Tiket VIP Timur Final FFA...

As subject..
WTT: 1 Unit Galaxy Tab *mint cond dengan 12 Tiket VIP Timur Final FFA...

Barangkali bisa nemu tiket disini.. hehehe..

Thanks.

-- 
===============
"

2. [isat-android] Happy birthday jakontil

Happy b'day beb,
tambah sukses yaaa...
Mau kado apa? *eh

Enya




> 

3. Database storage filling and securing

4. Oot: android dibahas di e-life style metro

5. 2.3 emulator and xhdpi support

6. GPU Tercepat Jatuh Pada Samsung鈥檚 Hummingbird

7. Andai Gmail App bisa kayak gini