In my android application, I save some events that I must sent to my server. All events that are sent, I must mark as "sent". The server, after I sent all events not marked (sent = 0), reply with an array of all ids that it has saved. Then, in android application, I execute an update query with all ids, but it don't work.
EventDao.java
@Dao
public interface EventDao {
@Query("UPDATE Event SET sent = 1 WHERE id IN (:ids)")
void updateSent(String ids)
}
MarkEvent.java
...
DatabaseClient.getInstance(context).getDb().eventDao().updateSent(response.join(","));
Log.d("MarkEvent", response.join(","));
...
"response" is a JSONArray with only integer. When the Server reply, I can read this in my Logcat:
D/MarkEvent: 2,3,4,5,6,7,8
this number are the correct ids of record