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. Archos/Android development

So I started porting an app over for the Archos developer 'contest'.
Got the skin, switched back to 1.5. Perhaps someone, somewhere has
some small experience with developing for the Internet Tablet 5....

- I have no 'extended status bar' showing on the emulator, which the
appslib document advises us to shrink our heights by 48 pixels for. If
I have a SurfaceView, surely the dimensions of that already take into
account the status bar. Or is the extended base a particularly
horrible kludge that overlaps the accessible screen area ?

- is there a developer forum somewhere, or a FAQ or *anything* except
that single page on appslib.com ?

- any idea where to download AppsLib.apk to try it on the emulator ?
The link on appslib.com gives me 404.

I'm sure these questions will come up a lot in the next days as people
port over for their Christmas gift.

TIA!

Lee

-- 

2. JSONObject text must begin with '{' at character 1



I don't know about the text of the error, but that does not look like
valid JSON. You have a couple of extra closing braces, AFAICT.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

-- 

3. Orientation change of gsm re-initializes the application

4. Orientation change of gsm re-initializes the application

5. Orientation change of gsm re-initializes the application

6. Speech Recognition makes a beep when the user Cancels. This is bad.

7. ArchOS emulator?