json - Android List View load more items when scroll to bottom and add footer loading view -
i using list view custom rows each item has 2 images , text field.
when user scroll bottom:
i want load more data web-service .
add loader in list view footer.
currently doing in way
listview.setonscrolllistener(new abslistview.onscrolllistener() { @override public void onscrollstatechanged(abslistview view, int scrollstate) { } @override public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { if (postadapter == null) return; if (postadapter.getcount() == 0) return; int l = visibleitemcount + firstvisibleitem; if (l >= totalitemcount && !refreshlayout.isrefreshing()) { listview.addfooterview(footer); dataifinternet(0); } }
what do: when user scroll bottom , part of last item comes visible
it start loading data.
add footer view.
but there problems don't want these :
it keep doing until last item visible.
since adding , removing footer view call notifydatasetchanged() reset list data , make images blink setting them again , again.
i need solve these issues:
- overcome images blink on reset. , somehow reset data without blink.
- not load data when last item little visible, instead of want reload data when scroll @ last y-axis point, when no area remains scroll (not 1 pixel).
Comments
Post a Comment