Můžu se ještě zeptat, co je špatně na tomto kódu?
Chci tam mít dvě tlačítka. Ale vytvářejí se pravděpodobně přes sebe.
Button myButton = new Button(getApplicationContext ());
myButton.setText("Button1 je best");
Button myButton2 = new Button(getApplicationContext ());
myButton2.setText("Button2 je betr");
setContentView(myButton);
setContentView(myButton2);
//ViewGroup.LayoutParams params = myButton.getLayoutParams();
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
// params.width = 40;
// params.height = 80;
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
myButton.setLayoutParams(params);
myButton2.setLayoutParams(params);