Hey guys I am parsing data from net and showing the images in grid When the activity is launched only 10 images开发者_运维百科 come from the server and are shown in grid with 3 images in one row. I want to load more images when the user scrolls down and reaches the row where there is only one image
There is a method onScrollChanged(int l, int t, int oldl, int oldt) which i have used earlier to make custom listView
But in this case i dont know how to use it
One way to do this is to detect it in your adapter's getView
method. You can check to see if the position
parameter refers to the last one you have loaded.
I haven't actually tried this, but I suspect what you want is similar to an auto grow listview. Check out the answer to Autogrow ListView in Android
The GridView uses a ListAdapter, so you should be able to use the EndlessAdapter mentioned. BTW, this is basically what @Matthew Willis is talking about.
精彩评论