0

I need this code for deleting the last dialed number in Kotlin :

    public void DeleteCallLogByNumber(String strNumber ) {   
    Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + " = ? ", strNumber , "");
    int idOfRowToDelete= cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID));
    getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null);
    }  
}
Dr Mido
  • 2,414
  • 4
  • 32
  • 72

0 Answers0