title: listview-SQLite updating the wrong row
body: <p>When I update the selected row it updates the wrong row for example if I select second row, it will update the first row.</p>
  
  <p>Here is my code inside db controller</p>
  
  <pre><code>Public boolean updateContact (String id, String category, String code, String description, String unit, String quantity) {
  
      SQLiteDatabase database = this.getWritableDatabase();
      ContentValues values = new ContentValues();
  
      values.put(FeedReaderContract.FeedEntry.Col_2 , category);
      values.put(FeedReaderContract.FeedEntry.Col_3 , code);
      values.put(FeedReaderContract.FeedEntry.Col_4 , description);
      values.put(FeedReaderContract.FeedEntry.Col_5 , unit);
      values.put(FeedReaderContract.FeedEntry.Col_6 , quantity);
      // updating row
       database.update(TABLE_NAME  ,values , FeedReaderContract.FeedEntry.Col_1 + " = ?" , new String[]{id} );
      return true;
  
  }
  public ArrayList&lt;HashMap&lt;String, String&gt;&gt; getAllProducts() {
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; proList;
      proList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      String selectQuery = "SELECT  * FROM Countsheet";
      SQLiteDatabase database = this.getWritableDatabase();
      Cursor cursor = database.rawQuery(selectQuery, null);
      if (cursor != null &amp;&amp; cursor.moveToFirst()) {
          do {
  
              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
              map.put("Category", cursor.getString(1));
              map.put("Code", cursor.getString(2));
              map.put("Description", cursor.getString(3));
              map.put("Unit", cursor.getString(4));
              map.put("Quantity", cursor.getString(5));
              proList.add(map);
  
          } while (cursor.moveToNext());
          cursor.close();
  
      }
  
      return proList;
  
  }
  </code></pre>
  
  <p>Here is my button onclick to update the listview:</p>
  
  <pre><code>Public void adddata(){
          btnadddata.setOnClickListener(
                  new View.OnClickListener(){
                      @Override
                      public void onClick(View v) {
                          boolean i =  myDb.updateContact(passid ,  passedVar , passcode, passdesc, passunit ,  quantitys.getText().toString());
  
                              if (i == true)
                                  Toast.makeText(Main2Activity.this , "Data Inserted" , Toast.LENGTH_SHORT).show();
                              else
                                  Toast.makeText(Main2Activity.this , "Data Not Inserted" , Toast.LENGTH_SHORT).show();
                      }
                  }
          );
      }
  </code></pre>