@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_entry_screen); FrameLayout fl = (FrameLayout)findViewById(R.id.ass); Test t = new Test(this); FrameLayout.LayoutParams lp = (LayoutParams) fl.getLayoutParams(); lp.height = LayoutParams.MATCH_PARENT; lp.width = LayoutParams.MATCH_PARENT; t.setOrientation(LinearLayout.VERTICAL); t.setLayoutParams(lp); fl.addView(t); t.setBackgroundColor(Color.YELLOW); Button b = new Button(this); b.setText("patricia"); t.addView(b); b = new Button(this); b.setText("monica"); t.addView(b); b = new Button(this); b.setText("rebecca"); t.addView(b); }