I have a strange problem.

I am using an efficient list adapter with a list which has row with a
text view and a button.Now on click of the button,I collapse that row
and download a file,with a progress bar.(this has been done along the
lines of the list collapsible adapter example of the api demos).

On click of the button,if any of the other rows have their progress
bar running(i interupt the download).I set the progress bar to 0 and
start of the download of the click of the row which has been clicked
latest,.

The code works perfectly ok when I have the list size to be 5.

When the list size is two, say i click row 1 and the progress bar is
25% complete.And then I click row 2.then still the progress bar shows
to be 25%,though I set the progress bar to 0.

Remember the same peice of code works for when the size of the list is 5.

The work around which I got was not to use the efficient list adapter
when the list size is 2.Immediately after that I fond that the code
starts to work like magic.

Is there anything that I am doing wrong? Or is there a lower limit in
the size as to when to use the efficient list adapter.And whats the
reason for such a behaviour.

Thanks.Let me know if I am not clear.









On 11/20/08, Mark Murphy <[EMAIL PROTECTED]> wrote:
>
> alexdonnini wrote:
>> Hello,
>>
>> I think I may have solved the problem. As I suspected (if I am right),
>> the solution was pretty simple. All I had to do is change:
>>
>> kill2 =  (Button) findViewById(R.id.kill2);
>> to
>> kill2 =  (Button) convertView.findViewById(R.id.kill2);
>
> Ah, yes.
>
> findViewById(R.id.kill2) searches the root view of your Activity for the
> item identified as kill2. convertView.findViewById(R.id.kill2) searches
> your list row for the item identified as kill2.
>
> The latter is definitely what you want.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to