Android App. has custom product GridView (ProductImage/ProductPrice/ProductDiscount).. every time user scroll down the App. fetch new products and updating GridView using notifyDataSetChanged(). - the problem is when updating GridView with new products, the scroll return to top of GridView which force user to scroll down again from the beginning of the GridView. Is there anyway can use to update GridView rather notifyDataSetChanged to stop updating the whole GridView?
Asked
Active
Viewed 716 times
0
-
Have you tried this answer ? http://stackoverflow.com/questions/13265457/lazy-download-images-into-gridview/13265776#13265776 – Ashish Tiwari Jan 25 '16 at 18:37
-
what exactly do you want to update? – Shahar Jan 25 '16 at 18:44
-
@AshishTiwari , yes i tried but i lost and didn't find what i want. – Safa Jan 25 '16 at 21:04
-
@Shahar ,i fetch 3 products at time and when scroll reached bottom the Asynctask fetches new 3 products and redraw the GridView to show 6 products now, what i want that scroll stay at the same postion at middle of GridView and not moved to the start of GridView, show new products into GridView without redrawing the whole GridView.. – Safa Jan 25 '16 at 21:20
1 Answers
0
I would suggest using RecyclerView like Vogella is showing here
than you can add items and use on of those
RecyclerView.Adapter.notifyItemChanged(int position);
RecyclerView.Adapter.notifyItemInserted(int position);
RecyclerView.Adapter.notifyItemRangeInserted(int positionStart, int positionEnd);
RecyclerView.Adapter.notifyItemRangeChanged(int positionStart, int positionEnd);

Shahar
- 3,692
- 4
- 25
- 47