Listview ArrayAdapter notifydatasetchanged () redraws very slowly

I have a pretty simple list with three textview fields in each row. We update their values ​​every 2 seconds or so with data coming from a background call to webservice (AsyncTask)

We compare the nearest values ​​with the current ones, update them accordingly on the adapter and, finally, call notifyDataSetChanged () if necessary

The fact is that redrawing becomes very slow, thus hanging the whole interface when we received more than three lines of update at once. Of course, we use all the well-known ListView optimizations, such as the EfficientAdapter (setTag () and holders) and getViewTypecount () / getItemViewType () approaches. We also tried to optimize our interface as much as possible with layoutopt and try to avoid the width and height of wrap_content in order to illuminate the situation.

We do not do expensive operations on our updates, just standard things: changing TextView text, text and color values.

The only thing I see is that getView () is called 3-4-5 times for each row, although I read all of these Romain messages [1] saying that there is nothing wrong with that

Any ideas or tips on how we can speed it up?

Many thanks!

[1] http://groups.google.com/group/android-developers/browse_thread/thread/4c4aedde22fe4594/aeb04288064f495e?show_docid=aeb04288064f495e

+5
2

, Google, , . , .

notifyDataSetChanged() MUCH FASTER, , listview.

. 3- max 10K row ArrayList .

notifyDataSetChange()

--- avg run-time: 4ms

notifyDataSetChange()

--- avg run-time: 0ms <--- you can't get faster than this.

, , . , .

+1

, ur textView URL-, . , "notifyDataSetChanged()", findViewByTag (URL- ) setText , . . .

0

All Articles