Here is my code
Button myButton = new Button(this);
myButton.setText("Press Me");
myButton.setTextColor(Color.WHITE);
LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout1);
layout.addView(myButton);
How do I add wrapcontent to this button?
Use this line (I used FILL_PARENT to demonstrate)