Get the array of RadioButtons in a RadioGroup in Android -


is there way of getting array (or collection) of radiobuttons in android radiogroup? add individual listeners radio buttons don't see obvious way of iterating on them.

this should trick:

        int count = radiogroup.getchildcount();         arraylist<radiobutton> listofradiobuttons = new arraylist<radiobutton>();         (int i=0;i<count;i++) {             view o = radiogroup.getchildat(i);             if (o instanceof radiobutton) {                 listofradiobuttons.add((radiobutton)o);             }         }         log.d(tag,"you have "+listofradiobuttons.size()+" radio buttons"); 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -