我正在尝试删除特定号码的所有通话记录。
try {
String strNumberOne[] = {number};
Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + "=? ", strNumberOne, "");
boolean bol = cursor.moveToFirst();
if (bol) {
do {
int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID));
getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null);
} while (cursor.moveToNext());
}
} catch (Exception ex) {
System.out.print("Exception here ");
}
我想发起一个LIKE
查询,因为 callLog 中保存的 mobNum 是 +916666666666,我传递的号码是 6666666666。所以它不匹配。有人可以帮我解决这个问题吗?