i want to add a view to a relativelayout. this view must be added to a specified position.
i have this:
int x = ...;
int y = ...;
button.setO
i have a workaround.
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
lp.leftMargin = x;
lp.topMargin = y;
relativelayout.addView(tmpTextButtonView, lp);
it is not great to use margin for positioning floating views. however it works for me.