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. Kindly unsubscribe my id ram...@agilees.com

Regards,

Ramesh Edessary

Phone: 630 242 3952 x 208||Fax: (630) 206-2397||Email:ram...@agilees.com

Agile Enterprise Solutions, Inc|| Ensuring Client's success||www.agilees.com

Great spot for recruiter/consultants- Join
-http://www.linkedin.com/groups?about=&gid=2034599&trk=anet_ug_grppro

"The quality of life reflects the quality of the questions we ask ourselves"

Note: If you have received this mail in error or prefer not to receive such
emails in the future, please reply with "REMOVE" in the subject line and the
email id(s) to be removed. All removal requests will be honored ASAP. We
sincerely apologize for any inconvenience caused.

 P Before printing, think about the environment 

Disclaimer: This document is intended for transmission to the named
recipient only. If you are not that person, you should note that legal
rights reside in this document and you are not authorized to access, read,
disclose, copy, use or otherwise deal with it and any such actions are
prohibited and may be unlawful. The views expressed in this document are not
necessarily those of Agile Enterprise Solutions, Inc. Notice is hereby given
that no representation, contract or other binding obligation shall be
created by this e-mail, which must be interpreted accordingly. Any
representations, contractual rights or obligations shall be separately
communicated in writing and signed in the original by a duly authorized
officer of the relevant company

 

-- 

2. Android Mythbusters (Matt Porter)

I read it, to me it sounds like its' written by someone who doesn't  
understand the complexities of mobile 'phone development.

Flexibility costs. It costs in terms of storage, processing  
requirements, and battery life. I've yet to see a full Linux/GNU  
installation on a phone sized device that can run for 24 hours without  
a charge, and I doubt that it would be possible, but hey, I'm always  
willing to be proven wrong if you can provide me with an example....

(and before anyone says N900, even Nokia don't try to call it a  
smartphone, they call it a Mobile Computer).

Al.
--

* Looking for Android Apps? - Try http://andappstore.com/ *

======
Funky Android Limited is registered in England & Wales with the  
company number  6741909.

The views expressed in this email are those of the author and not  
necessarily those of Funky Android Limited, it's associates, or it's  
subsidiaries.




> 

3. Show pictures on maps moved location to nearest street address.

4. 2.0 Droid

5. Non-braodcasting wifi access points and "HiddenSSID Enabler"

6. Droid Eris Keypad settings

7. Access voice data while in call