1

I have script that loads images from url using AsynkTasc. Now, i need dynamically ADD (not reload or other) images to already existing images when the user scrolls down, like in android market. I dont have any idea. I try notifyDataSetChanged, but as I know its refresh. But i need ADD. Please tell me what can i do ?

When I try setadapter settings, its just reload. Have GridView something like "AddToAdapter" :)

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview – Seshu Vinay Jan 07 '12 at 10:03
  • I know about LazyList, and I use it in my script. It is not useful for this project. Because if i have 1000000000000000000000000000000000000000000000000000 rows in my DB all they will downloaded. But I need djwnload ONLY 10 images and ADD to already downloaded images, then when user scroll down again 10 will downloaded and ADDed. If user not scroll down, then NOT downloaded. –  Jan 07 '12 at 12:20

2 Answers2

0

After your images are downloaded, you have to call notifyDataSetChanged, and then your adapter will have to regenerate views, taking into account the new data.

clemp6r
  • 3,665
  • 2
  • 26
  • 31
  • I know...so my question is how take it INTO. –  Jan 07 '12 at 11:28
  • It depends. You write the adapter, so you're responsible for managing the new data (i.e it's not automagic). Show us your adapter. – clemp6r Jan 07 '12 at 20:48
  • Thanks. I just use Adapter which extends BaseAdapter. with getCount(), getView and etc. –  Jan 08 '12 at 10:45
  • Please paste your adapter if you want more help – clemp6r Jan 08 '12 at 10:58
  • Thanks, but i dont think if i paste adapter, it something change, and someone can help me. So I find my own solution. –  Jan 09 '12 at 14:40
0

You can implement LoaderCallbacks interface in your GridView implementation.

You can find an example for ListViews in android developer website.

C.d.
  • 9,932
  • 6
  • 41
  • 51