简体   繁体   中英

How do I delete a single call log entry from my android call register programmatically

I need to delete a single call entry from the call register when the user clicks on clear this call .

I managed to delete all call entries of a number while user clicks on clear all calls for this number.

How can I clear a single entry from the call register?

i assume you have a details of that call entry which you want to delete then try like this

try {
             int idOfRowToDelete; // I assume you have this id;
            getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null);

                }
             catch (Exception ex) {
                System.out.print("Exception here ");
            }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM