Buggy code:
int decorCount = 0 ; for ( int i = 0 ; i < count ; i ++ ) { final View child = getChildAt ( i ) ; if ( ( child . getVisibility ( ) ) != ( GONE ) ) { final ViewPager . LayoutParams lp = ( ( ViewPager . LayoutParams ) ( child . getLayoutParams ( ) ) ) ; int childLeft = 0 ; int childTop = 0 ; if ( lp . isDecor ) { final int hgrav = ( lp . gravity ) & ( Gravity . HORIZONTAL_GRAVITY_MASK ) ; final int vgrav = ( lp . gravity ) & ( Gravity . VERTICAL_GRAVITY_MASK ) ; switch ( hgrav ) { default : childLeft = paddingLeft ; break ; case Gravity . LEFT : childLeft = paddingLeft ; paddingLeft += child . getMeasuredWidth ( ) ; break ; case Gravity . CENTER_HORIZONTAL : childLeft = Math . max ( ( ( width - ( child . getMeasuredWidth ( ) ) ) // 2 ) , paddingLeft ) ; break ; case Gravity . RIGHT : childLeft = ( width - paddingRight ) - ( child . getMeasuredWidth ( ) ) ; paddingRight += child . getMeasuredWidth ( ) ; break ; } switch ( vgrav ) { default : childTop = paddingTop ; break ; case Gravity . TOP : childTop = paddingTop ; paddingTop += child . getMeasuredHeight ( ) ; break ; case Gravity . CENTER_VERTICAL : childTop = Math . max ( ( ( height - ( child . getMeasuredHeight ( ) ) ) // 2 ) , paddingTop ) ; break ; case Gravity . BOTTOM : childTop = ( height - paddingBottom ) - ( child . getMeasuredHeight ( ) ) ; paddingBottom += child . getMeasuredHeight ( ) ; break ; } childLeft += scrollX ; child . layout ( childLeft , childTop , ( childLeft + ( child . getMeasuredWidth ( ) ) ) , ( childTop + ( child . getMeasuredHeight ( ) ) ) ) ; decorCount ++ ; } } } final int childWidth = ( width - paddingLeft ) - paddingRight ; for ( int i = 0 ; i < count ; i ++ ) { final View child = getChildAt ( i ) ; if ( ( child . getVisibility ( ) ) != ( GONE ) ) { final ViewPager . LayoutParams lp = ( ( ViewPager . LayoutParams ) ( child . getLayoutParams ( ) ) ) ; ViewPager . ItemInfo ii ; if ( ( ! ( lp . isDecor ) ) && ( ( ii = infoForChild ( child ) ) != null ) ) { int loff = ( ( int ) ( childWidth * ( ii . offset ) ) ) ; int childLeft = paddingLeft + loff ; int childTop = paddingTop ; if ( lp . needsMeasure ) { lp . needsMeasure = false ; final int widthSpec = MeasureSpec . makeMeasureSpec ( ( ( int ) ( childWidth * ( lp . widthFactor ) ) ) , EXACTLY ) ; final int heightSpec = MeasureSpec . makeMeasureSpec ( ( ( int ) ( ( height - paddingTop ) - paddingBottom ) ) , EXACTLY ) ; child . measure ( widthSpec , heightSpec ) ; } if ( ViewPager . DEBUG ) Log . v ( ViewPager . TAG , ( ( ( ( ( ( ( ( ( ( ( ( ( "Positioning<seq2seq4repair_space>#" + i ) + "<seq2seq4repair_space>" ) + child ) + "<seq2seq4repair_space>f=" ) + ( ii . object ) ) + ":" ) + childLeft ) + "," ) + childTop ) + "<seq2seq4repair_space>" ) + ( child . getMeasuredWidth ( ) ) ) + "x" ) + ( child . getMeasuredHeight ( ) ) ) ) ; child . layout ( childLeft , childTop , ( childLeft + ( child . getMeasuredWidth ( ) ) ) , ( childTop + ( child . getMeasuredHeight ( ) ) ) ) ; } } } mTopPageBounds = paddingTop ; mBottomPageBounds = height - paddingBottom ; mDecorChildCount = decorCount ; if ( mFirstLayout ) { <START_BUG> scrollToItem ( mCurItem , false , 0 , false ) ; <END_BUG> } mFirstLayout = false ; } @ Override public void computeScroll ( ) { } private boolean pageScrolled ( int xpos ) { } protected void onPageScrolled ( int position , float offset , int offsetPixels ) { } private void completeScroll ( boolean postEvents ) { } private boolean isGutterDrag ( float x , float dx ) { } private void enableLayers ( boolean enable ) { } @ Override public boolean onInterceptTouchEvent ( MotionEvent ev ) { } @ Override public boolean onTouchEvent ( MotionEvent ev ) { } private void requestParentDisallowInterceptTouchEvent ( boolean disallowIntercept ) { } private boolean performDrag ( float x ) { } private ViewPager . ItemInfo infoForCurrentScrollPosition ( ) { } private int determineTargetPage ( int currentPage , float pageOffset , int velocity , int deltaX ) { } @ Override public void draw ( Canvas canvas ) { } @ Override protected void onDraw ( Canvas canvas ) { } public boolean beginFakeDrag ( ) { } public void endFakeDrag ( ) { } public void fakeDragBy ( float xOffset ) { } public boolean isFakeDragging ( ) { } private void onSecondaryPointerUp ( MotionEvent ev ) { } private void endDrag ( ) { } private void setScrollingCacheEnabled ( boolean enabled ) { } public boolean canScrollHorizontally ( int direction ) { } protected boolean canScroll ( View v , boolean checkV , int dx , int x , int y ) { } @ Override public boolean dispatchKeyEvent ( KeyEvent event ) { } public boolean executeKeyEvent ( KeyEvent event ) { } public boolean arrowScroll ( int direction ) { } private Rect getChildRectInPagerCoordinates ( Rect outRect , View child ) { }

Fix:
scrollToItem ( mCurItem , false , 0 , true ) ;