private int getShouldDrawCount ( ) { if ( mPager . getAdapter ( ) instanceof InfinitePagerAdapter ) { return ( ( InfinitePagerAdapter ) mPager . getAdapter ( ) ) . getRealCount ( ) ; } else { return mPager . getAdapter ( ) . getCount ( ) ; } }
since we used a adapter wrapper so we can t getCount directly from wrapper .