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. About the network connectivity management

Hello,

I am studing android network connectivity management, for example, how does 
android detect the wifi connected and then how does android disable the 
GPRS(mobile) data connection?
Could anybody give me some reference documents or URL, or the direction of the 
related source code? 

Thank you very much!

-- 

2. Ralat: WTS: Desire + Milestone + Backflip + Legend

Maaf saya edit..
Lupa harus android only..:(

Selamat pagi,
Saya mau jual gadget sbb:
- htc desire bnib
- motorola milestone bnib
- motorola backflip bnib
- htc legend bnib

Minat japri ke: yo...@ratjoen.com
Thanks mods...

@yopiesuryadi
www.jeruknipis.com/forum

-- 
"Indonesian Android Community [id-android]" 

3. Changing text color of a substring drawed in a text view.

4. Finishing Browser

5. How can I know if OpenGl has drawn something?

6. Contribute to Android

7. Android Browser debug question