@ NonNull private ListDialog . OnItemSelectedListener createItemSelectedListener ( ) { return new ListDialog . OnItemSelectedListener ( ) { @ Override public void onItemSelected ( final int position ) { ColorPalettePreference . this . selectedIndex = position ; ColorPalettePreference . this . onClick ( getDialog ( ) , DialogInterface . BUTTON_POSITIVE ) ; if ( getDialog ( ) != null ) { getDialog ( ) . dismiss ( ) ; } } } ; }
Creates and returns a listener which allows to observe when a list item has been selected .