i get a jsonArray from server and show its data in an arraylist. any jsonObject have a status field. i want to check if status is "S" this jsonObject scroll to the top of the list. for example 3 jsonobject status is "S",i want to scroll this three item to the top of the list and another jsonobject which have status "R" below this three item.
IF you are using Recyclerview than use
layoutmanager.scrollToPosition(int position);
If you use Listview
listview.setSelection(int position);
If you are usin a listview, try
listView.setSelectionAfterHeaderView();
Or
list.smoothScrollToPosition(0);
with 0 for the first item or another index of an item if you have it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.