title: Returning only Last value in SQLite Select Statement
body: <p>Here i am trying to get all the data from the table in SQLite. But every time its returning   me only last rows twice(my table contains two rows only).</p>
  
  <pre><code>e.g
  ---------------------+
  | Id| name | mobile  |                  
  |--------------------|
  |1  | abc  | 123456  |
  |--------------------|
  |2  | xyz  | 789654  |
  +--------------------+
  </code></pre>
  
  <p>My code returning this:</p>
  
  <pre><code>01-11 00:14:59.291: D/Result:(27629): TID 12274, Name: Tablets , Image: [B@4275d578
  01-11 00:14:59.291: D/Result:(27629): TID 12274, Name: Tablets , Image: [B@4275d578
  </code></pre>
  
  <p>Here I am pasting my query code:</p>
  
  <pre><code>public List&lt;ProductCategoryDatabaseRetrieve&gt; getProductCategoryData() {
      List&lt;ProductCategoryDatabaseRetrieve&gt; productCategoryDatabaseRetrieve = new ArrayList&lt;ProductCategoryDatabaseRetrieve&gt;();
      ProductCategoryDatabaseRetrieve prodCatDB = new ProductCategoryDatabaseRetrieve();
      SQLiteDatabase sqliteDB = dbHandler.getWritableDatabase();
      String[] columns = { DatabaseHandler._TID,
              DatabaseHandler.TID,
              DatabaseHandler.PRODUCT_CATEGORY_NAME,
              DatabaseHandler.PRODUCT_CATEGORY_IMAGE };
      Cursor cursor = sqliteDB.query(DatabaseHandler.PRODUCT_CATEGORY_TABLE,
              columns, null, null, null, null, null);
      if (cursor.getCount() &gt; 0 &amp;&amp; cursor !=null) {
          while (cursor.moveToNext()) {
              prodCatDB.set_tid(cursor.getInt(cursor.getColumnIndex(DatabaseHandler._TID)));
              prodCatDB.setTid(String.valueOf(cursor.getInt(cursor
                      .getColumnIndex(DatabaseHandler.TID))));
              prodCatDB.setProductCategoryName(cursor.getString(cursor
                      .getColumnIndex(DatabaseHandler.PRODUCT_CATEGORY_NAME)));
              prodCatDB.setProductCategoryImage(cursor.getBlob(cursor
                      .getColumnIndex(DatabaseHandler.PRODUCT_CATEGORY_IMAGE)));
              productCategoryDatabaseRetrieve.add(prodCatDB);
      }
      } 
      dbHandler.close();
      return productCategoryDatabaseRetrieve;
  }
  </code></pre>
  
  <p>Thank a lot for considering.</p>