title: Android SQLiteDatabase update multiple rows using where clause with IN or OR
body: <p>I have the following code which I was using to update a single row in my database:</p>
  
  <pre><code>public int updateSentFieldForIncomingMessage(IncomingMessage incomingMessage)
  {
      SQLiteDatabase db;
      int numberOfRowsAffected;
  
      try
      {
          db = super.getWritableDatabase();
      }
      catch (SQLiteException e)
      {
          File dbFile = context.getDatabasePath(DATABASE_NAME);
          db = SQLiteDatabase.openDatabase(dbFile.getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
      }
  
      try
      {
          ContentValues values = new ContentValues();
          values.put(KEY_MESSAGE_SENT, true);
  
          numberOfRowsAffected = db.update(TABLE_INCOMING_MESSAGES, values, KEY_ID + " = ?", new String[]{String.valueOf(incomingMessage.getId())});
      }
      finally
      {
          db.close();
      }
  
      return numberOfRowsAffected;
  }
  </code></pre>
  
  <p>This works fine but now I'd like to refactor the method so that instead of a single IncomingMessage parameter, it accepts a list of IncomingMessage.  But when I get to this statement:</p>
  
  <pre><code>db.update(TABLE_INCOMING_MESSAGES, values, KEY_ID + " = ?", new String[]{String.valueOf(incomingMessage.getId())});
  </code></pre>
  
  <p>I'm not sure how to modify it so that I can specify multiple rows (via KEY_ID) in my WHERE clause.  What I'd like to do is say something like <code>KEY_ID IN ( &lt;multiple row IDs here&gt; )</code>.  Is that possible?</p>