Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SQLite: Update Statement

I need to implement SQLite in my application. I followed this tutorial.. Creating and using databases in Android one

Everything is working fine. I inserted 1 row with 5 columns. Now I want to update value of 1 column only and others will be remain same.

There is one update method in tutorial but it needs all the parameters, however I want to update only one column.

like image 458
vivek_Android Avatar asked May 13 '11 06:05

vivek_Android


1 Answers

You can use the code below.

String strFilter = "_id=" + Id; ContentValues args = new ContentValues(); args.put(KEY_TITLE, title); myDB.update("titles", args, strFilter, null); 
like image 162
Nikhil Avatar answered Oct 12 '22 23:10

Nikhil