example/src/main/java/de/mrapp/android/view/example/MainActivity.java
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();
            }

        };
    }
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.

@return The listener, which has been created, as an instance of the type {@link
Chip.CloseListener}