I declared a RelativeLayout in a xml layout file. Now I want to add Views from code to the existing Layout. I added a Button dynamical
RelativeLayout
Views
Button
Create another button:
Button tv2 = new Button(this); tv2.setText("World"); tv2.setLayoutParams(lprams); tv2.setId(2);
Add add it into your RelativeLayout:
rLayout.addView(tv2);