I have this code to delete a Callfrom CallLog.Callsprovider :
String strNumber= "myPhoneNumber"
String queryString= "NUMBER='" + strNumber + "'";
Log.v("Number", queryString);
int i=context.getContentResolver().delete(CallLog.Calls.CONTENT_URI, queryString, null);
if(i<1)
{
// do my stuff
}
This code work on android 2.2 but it does’nt work on android 2.3.3
There’is no error in the LogCat.
You should use the contract class provided by the SDK ( CallLog.Calls in your situation ) when building your queries.
The contract classes are meant to map the object model to the corresponding data names in the database. When the android team need to update a column name in the database, they also update the contract class and then no change is required for developpers.
Then try to change you query string to :
NOTE: the single-quote marks are necessary.
Also make sure the number is exactly matching the database number.
To be sure to delete the correct row you can do the following :
(didn’t try it but should work with small corrections)