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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -