public void setCheckedButtonByIndex(final int idx, final boolean checked) {
        if (idx >= 0 && idx < this.getChildCount()) {
            ((MaterialButton) getChildAt(idx)).setChecked(checked);
        }
    }
adds text buttons to this buttontogglegroup
main/src/main/java/cgeo/geocaching/ui/ButtonToggleGroup.java