private OnClickListener createFinishButtonListener ( ) { return new OnClickListener ( ) { @ Override public void onClick ( final View v ) { int selectedIndex = viewPager . getCurrentItem ( ) ; if ( notifyOnFinish ( selectedIndex ) ) { getDialog ( ) . dismiss ( ) ; } } } ; }
Creates and returns a listener which allows to close the dialog when the corresponding button is clicked .