Hello guys! I really need your help here..

I want to include one button inside each row in a ListActivity. When
pressing one of these buttons it will be disabled and will perform a
heavy task in the background (in a different thread to avoid screen
blocking). After the action is completed the button will be enabled
again and the row updated with some results obtained from that "heavy
operation".

Im filling my List with a custom SimpleCursorAdapter, its getView
method calls super.getView and in the view (row) returned I access its
button through findViewById and set my clicklistener (to disable it,
and launch the heavy task in the background). Once this heavy task is
finished I need a reference to this row view to find the button and re-
enable it.

SimpleCursorAdapter´s super.getView() reuses row views shown on screen
to avoid creating many different rows instances, so when my "heavy
task" is finished the row view reference i need to reenable its button
may have been reused in a different row, so in the end I am modifying
a button in a different row!

I have tried different solutions, for example giving different ID to
each row view (useless because it gets overwritten when the row view
is reused...) Obviously creating a different row instance for each row
whether its shown on screen or not isnt the best solution.

I really have no clue on how to solve this .. thanks in advance


--~--~---------~--~----~------------~-------~--~----~
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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to