I am using the following code, but experiencing some problems:
mDb.beginTransaction();
String updateQuery ="Query entered here";
String[] valVars = { Variables initialized here };
Cursor c = mDb.rawQuery(updateQuery, valVars);
if (c != null)
{
mDb.setTransactionSuccessful();
mDb.endTransaction();
return true;
}
else
{
mDb.endTransaction();
return false;
}
When I use debug instead of running return true, it directly reaches return false even it is in else statement. Please tell me what is the problem and how to do this properly.
Use this construction, as described in documentation: