Reputation: 11
I have a dynamic set of radio button in a radio group and I want the total number of button present in it. In this particular case, I have two radio button but how can I get the count of two?
for (int i = 0; i < listArray.length; i++) {
rb = new RadioButton(this);
rb.setId(i);
rb.setTextColor(this.getResources().getColor(R.color.white));
rb.setText(i);
rg.addView(rb, layoutParams);
}
Upvotes: 0
Views: 263