I am trying to create a screen with some dynamic controls, well radio buttons to be precise purely for learning purposes.
I have managed to add the radio button by referencing the radio group in the main.xml file.
RadioGroup rg = (RadioGroup)findViewById(R.Id.types);
RadioButton rb = new RadioButton(this);
rb.setText("some text!");
rg.addView(rb);
What I cannot figure out is how do I set the id of the radio button?
If use rb.setId() it wants an integer? I am trying to basicaly do the xml bit dynamically:
thanks