title: How to insert data into Sqlite Database using Loop?
body: <p>Here is my short code i am inserting 10 rows into table but after complete loop 
  why i have same visualisation like  "0  Net  0" ten time ?
  //Table Structure</p>
  
  <pre><code> String creater = "CREATE TABLE IF NOT EXISTS est (ID INTEGER PRIMARY KEY AUTOINCREMENT,codigo VARCHAR(10),"
      + "produto VARCHAR(1000), "
      + "qtd VARCHAR(10) ) ";
      sql.execSQL(creater);
  </code></pre>
  
  <p>//Loop of Insertion</p>
  
  <pre><code>   for(int i=0;i&lt;10;i++)
      {
      ContentValues values=new ContentValues(); 
      values.put("codigo", String.valueOf(i));
      values.put("produto", "Net");
      values.put("qtd", String.valueOf(i));
      sql.insert("est", null, values);
      }
  </code></pre>
  
  <p>//ArrayList</p>
  
  <pre><code>public  ArrayList&lt;String&gt;  estoque(SQLiteDatabase sql)
       {
      ArrayList&lt;String&gt; lst = new ArrayList&lt;String&gt;();
      try{
      String cmd ="select * from est";
      Cursor c = sql.rawQuery(cmd,null);
      c.moveToFirst();
      int i=0;
      while(c.getCount() &gt; i )
      {
      lst.add(c.getString(1)+"|"+c.getString(2)+"|"+c.getString(3));
      i++;
      }
      }catch(Exception ex){Log.e("ERROR", ex.getStackTrace().toString());}
      return lst;
      };
  </code></pre>
  
  <p>//ListView</p>
  
  <pre><code> ListView  listview =(ListView)findViewById(R.id.listview);
  ArrayList&lt;String&gt; estoque = new db().estoque(sql);
  ArrayAdapter&lt;String&gt; adapter1 = new ArrayAdapter&lt;String&gt;(this,
  android.R.layout.simple_list_item_1, estoque);
  adapter1.setDropDownViewResource(android.R.layout.simple_list_item_1);
  listview.setAdapter(adapter1);
  </code></pre>
  
  <p>//visualisation
  <code>"0 Net 0"</code> 10 time same. is there somthing wrong please help?</p>