title: sqlite table last row duplicates when passing values to arraylist
body: <p>I am trying to pass <code>sqlite</code> table values to an <code>arraylist</code>. The values of <code>sqlite</code> table shows correctly but when they are passed to <code>arraylist</code>.the last row duplicates the number of rows in <code>sqlite</code> table which means if the <code>sqlite</code> table is having 2 rows I am getting 2 indexes in <code>arraylist</code> but only the value of last inserted row duplicates again and again.please help me</p>
  
  <pre><code> if (cursor.moveToFirst()) {
          do {
              roleTableModel.setId(cursor.getInt(cursor.getColumnIndex(RoleTableModel.ID)));
              Log.d("Role id", String.valueOf(cursor.getInt(cursor.getColumnIndex(RoleTableModel.ID))));
              roleTableModel.setName(cursor.getString(cursor.getColumnIndex(RoleTableModel.ROLE_NAME)));
              Log.d("Role Name", String.valueOf(cursor.getString(cursor.getColumnIndex(RoleTableModel.ROLE_NAME))));
              roleTableModel.setValue(cursor.getInt(cursor.getColumnIndex(RoleTableModel.ROLE_COUNT)));
              Log.d("Role Value", String.valueOf(cursor.getInt(cursor.getColumnIndex(RoleTableModel.ROLE_COUNT))));
              roleDetails.add(roleTableModel);
  </code></pre>