title: How to declare n number of EditTexts dynamically in android?
body: <p>I have an SQLite Database in my application with fieldname,fieldtype columns.
  fieldname consists of EditText namimg ...ex: etsearch,etsave,etcancel etc..
  fieldtype is EditText.</p>
  
  <p>I add fieldname values dynamically. I need to declare these EditTexts in my java class, as i'am creating my layout using java code.</p>
  
  <p>I created an arraylist and added the fieldname values into it. I am confused how to declare the EditTexts using for loop. </p>
  
  <p>My code :</p>
  
  <pre><code>public class MainActivity extends Activity 
  {
  LinearLayout ll;
  LinearLayout llgrower;
  Cursor cursor;
  ArrayList&lt;String&gt; edittexts;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
  
      super.onCreate(savedInstanceState);
      ll = new LinearLayout(this);
      llgrower= new LinearLayout(this);
  
      ll.addView(llgrower);
      this.setContentView(ll);
  
      cursor = DataBase.getdata("query to get fieldname,fieldtype");
  
      try 
      {
          if (cursor.moveToFirst())
          {
              do
              {
                  edittexts.add(cursor.getString(0));
  
              } while (cursor.moveToNext());
          }
  
      } 
      catch (Exception e) {}
  
      for (int i=0;i&lt;edittexts.size();i++)
      {
  
      }
  </code></pre>
  
  <p>}</p>
  
  <p>}</p>