@NonNull
    @Override
    public Dialog onCreateDialog(final Bundle savedInstanceState) {
        int selected = getArguments().getInt(ARG_SELECTED_CHOICE);

        GroupAdapter adapter = new GroupAdapter();
        for (GitReference ref : getChoices()) {
            adapter.add(new RefDialogItem(ref, selected));
        }
        adapter.setOnItemClickListener(this);

        return createDialogBuilder()
                .adapter(adapter, null)
                .negativeText(R.string.cancel)
                .build();
    }
Confirm message and deliver callback to given activity

@param activity
@param requestCode
@param title
@param message
@param choices
@param selectedChoice
app/src/main/java/com/github/pockethub/android/ui/ref/RefDialogFragment.java