title: Adding multiple TextView on runTime android
body: <p>I'm trying to add multople TextViews to a relativeLayout on runtime.
  the reason is that the list is to be created, depending on users choises.</p>
  
  <p>I know how to add 1 textView. but when I entered the code to a loop and tried to creat more than 1, it just doesn't show anything..</p>
  
  <p>pleas help,</p>
  
  <pre><code> int left=70,top=25;
   for (String s:startLetterPos){
          params.leftMargin = left;
          top += 70;
          params.topMargin = top;
          TextView tv = new TextView(this);
          tv.setLayoutParams(params);
          tv.setText(s);
          tv.setVisibility(View.VISIBLE);
          tv.setTextSize(20);
  
          testLayout.addView(tv);
  
      }
  </code></pre>
  
  <p>EDIT: the full code of the activity:</p>
  
  <pre><code>package com.fgdvir.psychowords;
  
  import java.util.ArrayList;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.ImageView;
  import android.widget.RelativeLayout;
  import android.widget.RelativeLayout.LayoutParams;
  import android.widget.TextView;
  
  public class WordTest extends Activity {
      RelativeLayout testLayout;
      int            displayWidth, displayHeight;
      ArrayList&lt;String&gt; startLetterPos = new ArrayList&lt;String&gt;();
      //private int[] startLetterPos = new int[26];
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.word_test);
  
      startLetterPos = getIntent().getStringArrayListExtra("test");
  
      testLayout = (RelativeLayout) findViewById(R.id.word_test);
      create_questions();
      // Get Screen size
      /*
       * Display display = getWindowManager().getDefaultDisplay(); Point size = new `      `Point(); display.getSize(size);
       * displayWidth = size.x; displayHeight = size.y;
       */
  
  }
  
  public void create_questions() {
      int left=70,top=25;
      LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT
              , LayoutParams.WRAP_CONTENT);
      for (String s:startLetterPos){
          params.leftMargin = left;
          top += 70;
          params.topMargin = top;
          TextView tv = new TextView(this);
          tv.setLayoutParams(params);
          tv.setText(s);
          tv.setVisibility(View.VISIBLE);
          tv.setTextSize(20);
  
          testLayout.addView(tv);
  
      }
  
  }
  </code></pre>
  
  <p>}</p>