android - How to maintain scroll position of listview when the adapter update -
i bind adapter listview , @ first have fetch 10 records when scroll ends again items added in listview , works perfect. but when added items after scroll end @ time items added listview position set top. want set position new added items. here codes: onscroll function: public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { new items().execute(); } async function: class items extends asynctask<string, string, string> { @override protected void onpreexecute() { ... } protected string doinbackground(string... args) { list<namevaluepair> params = new arraylist<namevaluepair>(); params.add(new basicnamevaluepair("id", string.valueof(id))); jsonobject json = jparser.makehttprequest(url, "get", params); try { (int = 0; < products.length(); i++) { ...