title: Issue while Retreaving Data From SQLite using List
body: <p>I'm fetching Data form Table as list and adding that to sub list but i'm getting output that i didn't expect. I don't know how to Fix that so that i can get the output what i need.I have attached the code please help me to solve this issue??</p>
  
  <pre><code>public List&lt;List&lt;String&gt;&gt; fetchData(){
          List&lt;List&lt;String&gt;&gt; main= new ArrayList&lt;List&lt;String&gt;&gt;();
          List&lt;String&gt; sub= new ArrayList&lt;String&gt;();
          String qry="SELECT * FROM "+myTable+"";
          SQLiteDatabase db= this.getReadableDatabase();
          Cursor cursor=db.rawQuery(qry, null);
          if (cursor.moveToFirst()) {
              do {
                  System.out.println("-TblPOmaster-");
                  sub.add(cursor.getString(0));               
                  sub.add(cursor.getString(1));
                  sub.add(cursor.getString(2));
                  main.add(sub);
                  System.out.println("Data:"+main);
              } while (cursor.moveToNext());      
          }
          cursor.close();
          db.close();
          return main;
      }
  
  Output what i'm Getting Now
  Data:[[a1,a2,a3]]
  Data:[[a1,a2,a3,b1,b2,b3],[a1,a2,a3,b1,b2,b3]]
  Data:[[a1,a2,a3,b1,b2,b3,c1,c2,c3],[a1,a2,a3,b1,b2,b3,c1,c2,c3],[a1,a2,a3,b1,b2,b3,c1,c2,c3]]
  
      Output what i need
          Data:[[a1,a2,a3]]
          Data:[[a1,a2,a3],[b1,b2,b3]]
          Data:[[a1,a2,a3],[b1,b2,b3],[c1,c2,c3]]
  </code></pre>