android - Setting FragmentStatePagerAdapter count to 0 does not destroy any current visible fragments -
i have pageradapter dynamic number of elements. can modify number of tabs single call, clears list , count 0. unfortunately, not remove fragment showing.
public class mypageradapter extends fragmentstatepageradapter { private list<pojo> pojos = new arraylist<>; @override public int getcount() { return pojos.size(); } public void removeall() { this.pojos.clear(); notifydatasetchanged(); } }
does know how force viewpager clear himself?
update 1:
if use viewpager.removeallviews()
viewpager unusable afterwards after adapter notifies new data changes.
Comments
Post a Comment