I am using relative layout programmatically. It has multiple textviews but It shows horizontal not vertical. How do i get them as of paragraph view programmatically?
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
                params.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
    int x=10;
    int y=30;
    for(int i=0;i<arrayList.size();i++)
    {
                   String str=arrayList.get(i);
        int strLength=arrayList.size();
        if(arrayList.get(i).equals("Name")){
            y=y+10;
            x=65;
        }
        else
        {
            x=x+strLength+60;
        }
        //tv=(TextView) findViewById(R.id.tv1);
        tv=new TextView(this);
        tv.setText(arrayList.get(i).toString());
        tv.setPadding(x, y, 0, 0);
        layout.addView(tv, params);
    }
     scroll.addView(layout);
    this.setContentView(scroll);
 
     
     
    