I have listviews inside a pager adapter, and I'm trying to make it so when I click on an item inside my listview, it will scroll that item to the top. I have an onclicklistener to the item, but I'm not sure how exactly to implement the scrolling given what I have.
public Object instantiateItem(ViewGroup container, int position) {
List<App> app = this.apps.get(position);
ListView list = new ListView(this.activity);
list.setAdapter(adapter);
container.addView(list);
return list;
}
First, use ListView's onItemClickListener. Secondly, use the setSelected() method with the item's position (which you get on the listener).
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.