@Override
    protected void onResult(int resultCode) {
        Bundle arguments = getArguments();
        ArrayList<Label> selected = new ArrayList<>();
        ArrayList<Label> choices = getChoices();

        if (selectedChoices != null) {
            for (int i = 0; i < selectedChoices.length; i++) {
                if (selectedChoices[i]) {
                    selected.add(choices.get(i));
                }
            }
        }
        arguments.putParcelableArrayList(ARG_SELECTED, selected);

        super.onResult(resultCode);
        dismiss();
    }
Confirm message and deliver callback to given activity

@param activity
@param requestCode
@param title
@param message
@param choices
@param selectedChoices
app/src/main/java/com/github/pockethub/android/ui/issue/LabelsDialogFragment.java