title: Adding EditText to a layout in android with for-loop
body: <p>let me introduce you to my issue:</p>
  
  <p>I have just begun with programming for android.
  Now I want to create a little app that asks for the amount of players and then a new screen pops up with as many as EditText fields as the amount of players.</p>
  
  <p>Example: I type in the amount of players (4), then I press send, the next screen is filled with 4 EditText fields asking for the players names.</p>
  
  <p>Here's the code:</p>
  
  <p>Method that asks for the amount of players:</p>
  
  <pre><code>    public void gaVerder (View view){
      Intent i = new Intent(getApplicationContext(), NamenPersonen.class);
  
      String aantal = e.getText().toString();
      i.putExtra("aantal", aantal);
  
      startActivity(i);
  }
  </code></pre>
  
  <p>Method that delivers the EditText fields:</p>
  
  <pre><code>LinearLayout ll;
  EditText editText;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  
      Intent intent = getIntent();
  
      int aantal = Integer.parseInt(intent.getStringExtra("aantal"));
  
  
      List&lt;EditText&gt; myList = new ArrayList&lt;EditText&gt;();
  
      EditText myEt1 = new EditText(this);
      myEt1.setHint("Geef uw naam in.");
      myList.add(myEt1);
  
  
      for(int i=0;i&lt;aantal;i++)
      {
          editText = new EditText(this);
          editText.setHint("Geef een naam in");
  
  
          ll.addView(editText);
      }
  
  
      setupActionBar();
      setContentView(R.layout.namenpersonenxml);
  }
  </code></pre>
  
  <p>It's the for-loop part and adding it to the lay-out that isn't working. Also I can't figure out how to debug it, I'm used to debugging Java applications in Netbeans (for android I'm using Eclipse).</p>