public void show() {

        final boolean atLeastOneElementHasIcon = CollectionStream.of(items).filter(i -> i.icon > 0).count() > 0;

        final Consumer<Item> clickListener = (it) -> {
            if (it.selectAction != null) {
                it.selectAction.call(it);
            }
            if (dialogClickAction != null) {
                final int pos = this.items.indexOf(it);
                if (pos >= 0) {
                    dialogClickAction.call(pos);
                }
            }
        };

        final SimpleDialog.ItemSelectModel<ContextMenuDialog.Item> model = new SimpleDialog.ItemSelectModel<>();
        model
            .setItems(items)
            .setDisplayMapper((it) -> TextParam.text(it.toString()).setImage(atLeastOneElementHasIcon ? ImageParam.id(it.icon) : null, atLeastOneElementHasIcon ? 30 : 0))
            .setChoiceMode(SimpleItemListModel.ChoiceMode.SINGLE_PLAIN);

        SimpleDialog.of(this.activity).setTitle(this.title == null ? null : TextParam.text(this.title))
                .selectSingle(model, clickListener);
    }
Represents a dialog usable as a context menu for various elements.
<br>
Supports textual items with or without accompanying icon.
main/src/main/java/cgeo/geocaching/ui/dialog/ContextMenuDialog.java