I\'m trying to add multiple layouts dynamically under each other. So I wrote the following code:
for (int i = 1; i <= layoutCounter; i++) {
Vie
Maybe with:
params.addRule(RelativeLayout.BELOW, layoutID-1);
instead of:
params.addRule(RelativeLayout.BELOW, neu.getId());
in your else condition.
You can try like this
RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(...)
rl.addRule(RelativeLayout.BELOW, anotherview.getId())
rl.addRule(RelativeLayout.ALIGN_PARENT_LEFT)
parentLayout.addView(myView, rl)