Re: [android-developers] Listview with image, text and checkbox

2011-07-28 Thread Viral Brahmbhatt
I have done this with the help of a boolean arraylist maintaining the state of the check boxes On Wed, Jul 27, 2011 at 10:23 PM, Simon Platten simonaplat...@googlemail.com wrote: In a nutshell as was said by the last poster, the listview re-uses the same objects over and over for those items

Re: [android-developers] Listview with image, text and checkbox

2011-07-27 Thread Viral Brahmbhatt
Hi Abhishek, I have placed the converView = null; as my first line in getView() method. Now, the problem, that i mentioned earlier is not there (multiple checkboxes get selected when i select one checkbox in view). But, when i scroll the view up and down, i lose my selected checkbox (it get's

Re: [android-developers] Listview with image, text and checkbox

2011-07-27 Thread Viral Brahmbhatt
Hi Simon, I have used the same code in my program.. but the issue is there, it checks the check boxes in view, when you scroll them out, as i have mentioned in my earlier post. As per suggestion from Abhishek, I have placed the converView = null; as my first line in getView() method. With this

Re: [android-developers] Listview with image, text and checkbox

2011-07-27 Thread Viral Brahmbhatt
Any body having any luck on this? On Wed, Jul 27, 2011 at 2:59 PM, Viral Brahmbhatt viralbrahmbh...@gmail.com wrote: Hi Simon/Abhishek, I am attaching herewith the sample project. Please have a look, and let me know, if you can help me out. On Wed, Jul 27, 2011 at 1:50 PM, Viral

Re: [android-developers] Listview with image, text and checkbox

2011-07-27 Thread feiyangfeixue feiyangfeixue
Some day ago, the same problem occures to me. The reason is that the ListView is design to reuse the ListItem, which means that the Item #9 and #17 reuse items #0-#8. So you should find some to maintain the View status ( such as checkbox check status ) in some data structure. For example ,you

Re: [android-developers] Listview with image, text and checkbox

2011-07-27 Thread Simon Platten
In a nutshell as was said by the last poster, the listview re-uses the same objects over and over for those items on view. In your adapter you can have an array which contains the entire content but you should be very careful that you aren't storing to much in this array, for example don't

[android-developers] Listview with image, text and checkbox

2011-07-26 Thread Viral Brahmbhatt
Hi there, I am trying to implement a listview with image, text and checkbox within it, using baseadapter. the problem is, let's say i have 20 items in list, so when i select the first item checkbox, and scroll down the list, i can see the item #9 and #17 also get checked automatically. can

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Simon Platten
I am doing something very similar its because the views in the listview are re-used as you scroll them out of view they are re-cycled for the new views coming into view. You need to manage the change over in the getView method. On Tue, Jul 26, 2011 at 1:33 PM, Viral Brahmbhatt

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Viral Brahmbhatt
Hi Simon, Find below my getView() method call let me know, what do i need to do? --- public View getView(final int position, View converView, ViewGroup parent) { ViewHolder holder; try { // TODO Auto-generated method stub ImageView imageView = null; TextView textView

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Simon Platten
I'm at work atm, when I get home I will take a look, its 14:49 here (GMT) shoudl be home at 17:30 ish. On Tue, Jul 26, 2011 at 2:23 PM, Viral Brahmbhatt viralbrahmbh...@gmail.com wrote: Hi Simon, Find below my getView() method call let me know, what do i need to do?

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Viral Brahmbhatt
ok.. np.. thanks for your response. plz note my skype id: viralbrahmbhatt. if you can add me to your list, we can directly chat on this. On Tue, Jul 26, 2011 at 7:20 PM, Simon Platten simonaplat...@googlemail.com wrote: I'm at work atm, when I get home I will take a look, its 14:49 here

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Simon Platten
Thank you, I don't have skype set-up atm, my kids stole my headset...email is good :) On Tue, Jul 26, 2011 at 2:57 PM, Viral Brahmbhatt viralbrahmbh...@gmail.com wrote: ok.. np.. thanks for your response. plz note my skype id: viralbrahmbhatt. if you can add me to your list, we can

Re: [android-developers] Listview with image, text and checkbox

2011-07-26 Thread Simon Platten
ok, this isn't my code but its a good starting point: public View getView(int position, View convertView, ViewGroup parent) { View vi=convertView; ViewHolder holder; if(convertView==null){ vi = inflater.inflate(R.layout.item, null); holder=new