简体   繁体   English

如何在通话记录中读取和删除留言记录?

[英]How to read and delete messages log in call logs?

I can read and delete all call log and sms/mms message using below content uris. 我可以使用以下内容uris读取和删除所有呼叫日志和短信/彩信。

ContentResolver cr;
Cursor cursor = cr.query(contentUri, null, where, null, null);  // read
cr.delete(contentUri, where, null); // delete

Calls.CONTENT_URI; // Call Log Uri.
Sms.CONTENT_URI // SMS Uri // Uri.parse("content://sms")
Mms.CONTENT_URI // MMS Uri // Uri.parse("content://mms")

So I can get count of logs. 这样我就可以计数日志了。 and delete them. 并删除它们。

But Text message logs (in contacts app. see attached images) are not deleted. 但是不会删除短信日志(在联系人应用程序中。请参阅附件图像)。 (Messages are deleted) (消息已删除)

My test device is Samsung Galaxy S4 mini. 我的测试设备是三星Galaxy S4 mini。

在此处输入图片说明在此处输入图片说明

三星自定义消息日志不是标准的Android ContentProvider :没有标准的访问方式,除非三星为其实现了自定义ContentProvider ,否则可能无法访问它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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