private Chip . CloseListener createChipCloseListener ( ) { return new Chip . CloseListener ( ) { @ Override public void onChipClosed ( @ NonNull final Chip chip ) { chip . setVisibility ( View . GONE ) ; Toast . makeText ( MainActivity . this , R . string . chip_closed_toast , Toast . LENGTH_SHORT ) . show ( ) ; } } ; }
Creates and returns a listener which allows to show a toast when a chip has been closed .