import android.content.ContentResolver;
import android.provider.CallLog;
import android.database.Cursor;
import android.net.Uri;
/* Get the content resolver to access call log */
ContentResolver resolver = context.getContentResolver();
/* Query the call log for missed calls, sorted by date descending */
Uri callLogUri = CallLog.Calls.CONTENT_URI;
String selection = CallLog.Calls.TYPE + " = ?";
String[] selectionArgs = new String[] { String.valueOf(CallLog.Calls.MISSED_TYPE) };
String sortOrder = CallLog.Calls.DATE + " DESC";
Cursor cursor = resolver.query(callLogUri, null, selection, selectionArgs, sortOrder);
/* Check if there are any missed calls */
if (cursor != null && cursor.moveToFirst()) {
/* Get the ID of the most recent missed call */
int idIndex = cursor.getColumnIndex(CallLog.Calls._ID);
String callId = cursor.getString(idIndex);
/* Delete the missed call entry */
Uri deleteUri = Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, callId);
resolver.delete(deleteUri, null, null);
cursor.close();
}