Pretty much I have 1 main layout being a Vertical LinearLayout, at the press of a button I want to be able to add a horizontal layout with 2 edit texts. What i've done here doesn't work, no errors but nothing happens.
public void addView(View v){
LinearLayout mainLayout =(LinearLayout)findViewById(R.id.activity_main);
LinearLayout h = new LinearLayout(this);
h.setOrientation(LinearLayout.HORIZONTAL);
h.addView(new EditText(this));
h.addView(new EditText(this));
mainLayout.addView(h);
}