Reputation: 133
How to get the number of RadioGroups added dynamically in Layout and number of RadioButtons added in respective RadioGroup??
Upvotes: 0
Views: 130
Reputation: 681
What you can do here is obtain a reference to the container of the layout. For Ex -
RelativeLayout rl=(RelativeLayout)findViewbyId(R.id.relative);
System.out.println(rl.getChildCount());
This will print the childs of the container view. If your layout contains only radiobuttons, your job is done.
Hope this helps! :)
Upvotes: 1