I am having linear layout with orientation horizontal in my XML file and i am trying to add text views using below code.
LayoutParams lparams = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
TextView tv=new TextView(this);
tv.setLayoutParams(lparams);
tv.setText("Sample");
myLinearLayout.addView(tv);
Adding 5 text views in the similar fashion looks fine but if am trying to add more text views they are moving out the screen. I know using horizontal orientation aligns all views in horizontal direction. But how can i make changes to my design/code so that, the hidden text views automatically moves to the next line. Can anyone suggest me. Thanks in advance.