android - TabLayout: Click on Tab TextView to scroll on top of listview -
i have 2 fragments within tablayout. now, want add onclick listener tablayout. fragments contain listview, each. possible click on tablayout , put listview top? thanks.
override ontabreslected(tab tab)
method , scroll listview
position 0.
@override public void ontabreselected(tab tab){ if(mlistview.getadapter() != null && mlistview.getadapter().getitemcount() > 0) mlistview.smoothscrolltoposition(0); }
Comments
Post a Comment