Code example for FragmentStatePagerAdapter

Methods: notifyDataSetChanged

0
        holder.params = params;
 
        int position = mHolderList.size();
        mHolderList.add(position, holder);
        mPagerHeader.add(position, label);
        notifyDataSetChanged(); 
    } 
     
    /** 
     * Return the Fragment instance associated with a specified position. 
     */ 
    public Fragment getFragment(int position) {
        WeakReference<Fragment> weakFragment = mWeakFragmentMap.get(position);
        if (weakFragment != null && weakFragment.get() != null) {
            return weakFragment.get();
        } else { 
            return getItem(position);
        } 
    } 
 
    @Override