How do I update an android sqlite database column value to null using ContentValues?

AndroidSqlDatabaseSqlite

Android Problem Overview


For example, I want to do the following on a database update.

Is there a constant I can use instead of null, which won't compile if I use it like:

ContentValues args = new ContentValues();
args.put(KEY_RISK_AMOUNT, null); // what constant do I use instead of null?

Android Solutions


Solution 1 - Android

Use ContentValues.putNull(java.lang.String):

ContentValues args = new ContentValues();
args.putNull(KEY_RISK_AMOUNT);

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsteveView Question on Stackoverflow
Solution 1 - AndroidskolimaView Answer on Stackoverflow