public void show(Collection<Label> selectedLabels) {
        labelsSingle.subscribe(labels -> {
            final boolean[] checked = new boolean[labels.size()];
            if (selectedLabels != null && !selectedLabels.isEmpty()) {
                Set<String> selectedNames = new HashSet<>();
                for (Label label : selectedLabels) {
                    selectedNames.add(label.name());
                }
                for (int i = 0; i < checked.length; i++) {
                    if (selectedNames.contains(labels.get(i).name())) {
                        checked[i] = true;
                    }
                }
            }
            LabelsDialogFragment.show(activity, requestCode,
                    activity.getString(R.string.select_labels), null, new ArrayList<>(labels), checked);
        }, error -> {
            Log.e(TAG, "Exception loading labels", error);
            ToastUtils.show(activity, R.string.error_labels_load);
        });
    }
Show dialog with given labels selected

@param selectedLabels
app/src/main/java/com/github/pockethub/android/ui/issue/LabelsDialog.java