private OnClickListener createRemovePreferenceHeaderClickListener ( ) { return new OnClickListener ( ) { @ Override public void onClick ( final DialogInterface dialog , final int which ) { int position = spinner . getSelectedItemPosition ( ) ; listener . onRemovePreferenceHeader ( position ) ; } } ; }
Creates and returns a listener which allows to notify the registered listener when the user closes the dialog confirmatively .