Load More Item In Lazy Adapter And Listview
I am going to load more data in my list view. I can load more data but it will remove previous data. What should i do to append data in my list view ? Here is my source code: OnCr
Solution 1:
I don't see where you are instantiating 'pa' but the problem is you create a new adapter everytime and then overwrite the 'pa'. You need to move your logic up from:
adapter = new PostAdapter(_activity, PostList);
adapter.notifyDataSetChanged();
if ( pa == null ) {
pa = adapter;
} else {
// I Think, I shoud update Adapter Here...!
}
pa.notifyDataSetChanged();
_list.setAdapter(pa);
To
if ( pa == null ) {
adapter = new PostAdapter(_activity, PostList);
pa = adapter;
}else{
pa.append(PostList); //You would need to create this method.
}
pa.notifyDataSetChanged();
_list.setAdapter(pa);
Post a Comment for "Load More Item In Lazy Adapter And Listview"