简体   繁体   中英

Why can't I edit the call log for an unsaved incoming number?

I want to edit a call log history. I wrote simple code for editing the call log. I put CACHED_NAME or other name variables, but I didn't see any changes in the call log. Why doesn't it work? Here is my code:

ContentValues values = new ContentValues();
values.put(CallLog.Calls.CACHED_NAME, "Edited Name");
getContentResolver().update(CallLog.Calls.CONTENT_URI,
values, CallLog.Calls.NUMBER + "=?", new String[] { String.valueOf(number) });

Edit: I added write and read call log permissions in the manifest file.

Because the system doesn't want random apps to be able to update the call log with possibly incorrect data. So they don't export that capability to just any app- you have to be the registered telecom app.

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