これは私のコードのスニペットです。あなたが求めているものはどれですか。
// get the parent element which will hold your newly created objects
LinearLayout layout = (LinearLayout) findViewById(R.id.shouldContainer);
// create the laout parameters objects which will hold information how you would like your widget to be presented
//you can specify the same attributes as doing it "staticly" with XML file
LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT, 0);
layoutParams.weight = 1;
//create your desired object, add listneres to it, text and more
Button button = new Button(this);
//add your object, in this case button to the parent element on given position with given layout parameters
layout.addView(button, position, layoutParams);
もちろん、必要に応じてレイアウト オプションを構成する必要があります。