title: How to make a dynamic grid of EditText
body: <p>I want to create Dynamic grid of edittext but it gives me an IllegalStateException:</p>
  
  <blockquote>
    <p>The specific child already has a prent, You must call <code>removeView()</code>
    on child parent first.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>for (int x = 0; x &lt; no_of_rows; x++)
  {
      ll = new LinearLayout(this.getApplicationContext());
      ll.setLayoutParams(new LinearLayout.LayoutParams(
          LinearLayout.LayoutParams.FILL_PARENT,
          LinearLayout.LayoutParams.WRAP_CONTENT));
      ll.setOrientation(0);
  
      for(int y = 0; y &lt; no_of_columns; y++){
          LinearLayout(this.getApplicationContext());
          this.edittext2.add(new EditText(this.getApplicationContext()));
          this.edittext2.get(y).setId(y);
          this.edittext2.get(y).setLayoutParams(new LinearLayout.LayoutParams(
                      LinearLayout.LayoutParams.FILL_PARENT
                      ,LinearLayout.LayoutParams.WRAP_CONTENT));
          this.edittext2.get(y).setMaxLines(1);
          this.edittext2.get(y).setText("Something");
          ll.addView(this.edittext2.get(y));
      }
      tlayout.addView(ll);
  }
  </code></pre>