private OnClickListener createListItemListener ( ) { return new OnClickListener ( ) { @ Override public void onClick ( final DialogInterface dialog , final int which ) { selectedIndex = which ; ListPreference . this . onClick ( dialog , DialogInterface . BUTTON_POSITIVE ) ; dialog . dismiss ( ) ; } } ; }
Creates and returns a listener which allows to persist the value a list item which is clicked by the user .