public int scrollToPage ( int pageNumber ) { Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "scrollToPage pageNumber = %d mPageCount = %d" , pageNumber , mPageCount ) ; if ( mSupportScrollByPage && ( mScrollOver || ( pageNumber >= 0 && pageNumber <= mPageCount - 1 ) ) ) { scrollToItem ( getFirstItemIndexOnPage ( pageNumber ) ) ; } else { Log . w ( TAG , "Pagination is not enabled!" ) ; } return mCurrentItemIndex ; }
Scroll to specific page . The final page might be different from the requested one if the requested page is larger than the last page . To process the scrolling by pages LayoutScroller must be constructed with a pageSize greater than zero .