I have an android xml layout, main.xml. I would like to add controls to this layout at runtime (I would like to add a series of additional linear layouts that contain button
Try this :
LinearLayout ll =(LinearLayout)findViewById(R.id.linlay); Button b = new Button(this); b.setText("Hello"); l.addView(b);
This might help you