Monday, April 30, 2012

update field values based on current field values content provider android

I cannot get to update the field values of a content provider as a function of current field values.
For a single column, I try to do



...
ContentValues values = new ContentValues();
values.put(TableInOut.INOUT, TableInOut.INOUT + " + 1"); (*)
int numRowsUpdated = getContentResolver().update(TableInOut.CONTENT_URI_PRESENCE, values, "time_details > lastSafeEpoch.toString()", null);
values.clear();
...


LogCat says that numRowsUpdated are the expected ones, but there is no update?!
Any ideas please?



(*)
No luck even with these



values.put(TableInOut.INOUT,  "88 + 1"); 
values.put(TableInOut.INOUT, "\"" +TableInOut.INOUT + "\"" + " + 1");


These work, but they do not use current values



values.put(TableInOut.INOUT,  77); 
values.put(TableInOut.INOUT, "77");




No comments:

Post a Comment