Android元素下所有CheckBox选中检查

private List<String> getSelectColumns() {
        List<String> findColumns = new ArrayList<>();
        int childCount = db_linear_cb_list.getChildCount();
        for (int i = 0; i < childCount; i++) {
            CheckBox checkBox = (CheckBox) db_linear_cb_list.getChildAt(i);
            if (checkBox.isChecked()) {
                String cb_sel_val = checkBox.getText().toString().trim();
                System.out.println("已选择字段:" + cb_sel_val);
                findColumns.add(cb_sel_val);
            }
        }
        return findColumns;
    }

db_linear_cb_list 为 【LinearLayout】节点