0

Possible Duplicate:
How to update Android ListView with dynamic data in real time?

I have a custom listview working with a time value and some buttons to click in it. I currently have the time updated every second via notifyDataSetChanged() in a one second handler method.

This works nicely in updating the time. Unfortunately though it means the views are recreated every second. This means my button press operation isn't very responsive as each time the view is regenerated the button is reset. So if you are pressing a button while the view changes, the press becomes invalid and you have to release the button and then press it again. With a long press the problem is even worse as there isn't enough time to register a long press before the view is regenerated. So a long press never happens.

Is there a way to change data within the listview without have to regenerate the whole view?

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
  • check out [this](http://stackoverflow.com/questions/5846385/how-to-update-android-listview-with-dynamic-data-in-real-time) question – keyser May 10 '12 at 08:11
  • Yep, I found that after autobot_101 triggered a thought. That is the way to go about it. Thanks – Trevor White May 10 '12 at 09:14

1 Answers1

0

Try to implement something, FlashTextView for example, that can render itself in real time. So each time your clock needs to update value in this textview, you can call some method from these flash-textview to change itself, without touching to the ListView and whole item of listview.

toantran
  • 1,789
  • 17
  • 25