SQLite Beginner Question. Android Content resolver.update(...) insert(...)
Do I explicitly write WH开发者_高级运维ERE clause for insert/updates?
Like so:
cr.update(uri, values, "WHERE _id="+id, null);
Try
String[] args = {String.valueOf(id)};
cr.update(uri, values, Data._ID + "=?", args);
ContentResolver.update()
About the where
parameter:
A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself).
精彩评论