public void show(GitReference selectedRef) {
        refSingle.subscribe(refs -> {
            int checked = -1;
            if (selectedRef != null) {
                String ref = selectedRef.ref();
                for (int i = 0; i < refs.size(); i++) {
                    String candidate = refs.get(i).ref();
                    if (ref.equals(candidate) || ref.equals(RefUtils.getName(candidate))) {
                        checked = i;
                        break;
                    }
                }
            }

            RefDialogFragment.show(activity, requestCode,
                    activity.getString(R.string.select_ref), null, new ArrayList<>(refs), checked);
        }, e -> {
            Log.d(TAG, "Exception loading references", e);
            ToastUtils.show(activity, R.string.error_refs_load);
        });
    }
Show dialog with given reference selected

@param selectedRef
app/src/main/java/com/github/pockethub/android/ui/ref/RefDialog.java