0

In my app i have a ListView with an ArrayAdapter. Every Item contains a picture, which takes a bit of time to render. Now i want to add items dynamicly at the end of the List. The problem is, that wehenever add() is called my List blinks, because notifyDataSetChanged() is called and my pictures take a few milliseconds to render. I tried to avoid this by calling setNotifyOnChange(false). I solved the blinking with that, but unfortunately it is only updating the "length" of my list irregularly. Is there some way to update the "length" of my listview, without updating the views which are shown?

invertigo
  • 6,336
  • 5
  • 39
  • 64
antumin
  • 167
  • 1
  • 12

1 Answers1

0

I would agree that the UI thread should be avoided, especially for lists, and especially when using images for each list item. Perhaps you need to find a more robust list adapter that is geared towards images? See this question for some helpful ideas/hints at how to improve your own list.

Also, the AndroidQuery (AQuery) library may be useful when fetching images for use in the arrayadapter: Image Loading via AQuery. It takes care of the burden of image caching as well, which I have found to be quite useful.

Community
  • 1
  • 1
MiStr
  • 1,193
  • 10
  • 17
  • The images are not rendered in the UI Thread but in a seperate Thread. The images are blinking anyway, because they take time to render. The UI Thread still runs smoth while loading images. Maybe I should try caching the rendered images... – antumin Jun 14 '13 at 21:36
  • 1
    @user1901241 No, you should try reading what Basbous wrote in the comments and provide full code. – BackSlash Jun 14 '13 at 21:43