I referred the following pages but still my problem is not solved,
Android sqlite update table always return 0 , SQLite in Android How to update a specific row , Android SQLite update row not working , Update Function in android SQLite is not working and SQLiteDatabase update not working?
I have a sqlite database as QUESTIONS(ID,QUES,ANS),ID is the primary key. When i try to update a value using following code no change happens in the database.
SQLiteDatabase db = null;
ContentValues values = new ContentValues();
values.put("QUES","New title");
values.put("ANS","Answer" );
long k= db.update("QUESTIONS",values,"ID=2",null);
Log.d("Success",""+k);
The value of k is 1, And there is no change in database. I also tried with
long k= db.update("QUESTIONS",values,null,null);
But no use .