Code example for FragmentStatePagerAdapter

Methods: getItem

0
        return getBlockAt(getCurrentItem()); 
    } 
 
    public CBlock getBlockAt(int position) {
        if (mDefaultAdapter != null && (mDefaultAdapter instanceof FragmentStatePagerAdapter)) {
            Fragment fragment = mDefaultAdapter.getItem(position);
            if (fragment instanceof CBlockFragment) {
                return ((CBlockFragment) fragment).getBlock();
            } 
        } 
        return null; 
    } 
 
    public int getBlockCount() { 
        if (mDefaultAdapter != null && (mDefaultAdapter instanceof FragmentStatePagerAdapter)) {
            return mDefaultAdapter.getCount();
        } 
        return 0; 
    } 
	 
	private class DefaultFragmentPagerAdapter extends FragmentStatePagerAdapter {