I have read plenty of examples ,but if I wish to maintain my scroll position after a ListView
is updated from JSON
,then can I do that without using an
For overall picture:
In your API response callback, call this function(example) below:
MyAdapter mAdapter;
ArrayList mUsers;
private void updateListView(ArrayList users) {
mUsers.addAll(users);
if(mAdapter == null) {
mAdapter = new MyAdapter(getContext(), mUsers);
mListView.setAdapter(mAdapter);
}
mAdapter.notifyDataSetChanged(); // Add this one
}