Code example for FragmentPagerAdapter

Methods: notifyDataSetChanged

1
        super(manager);
    } 
 
    public void addFragment(Fragment fragment) {
        mFragments.add(fragment);
        notifyDataSetChanged(); 
    } 
 
    @Override 
    public int getCount() { 
        return mFragments.size();
    } 
 
    @Override 
    public Fragment getItem(int position) {
        return mFragments.get(position);
    } 
 
}