如何从Android的删除通话记录编程? [英] How to remove call logs from android programmatically?
本文介绍了如何从Android的删除通话记录编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何删除/从应用程序中删除通话记录。我做这样的
how to delete/remove call log from application. I am doing like this
this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null);
它不工作。
推荐答案
请确保u必须按照manifast.xml权限:
make sure u have following permission in manifast.xml:
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
删除Calllogs特定数量试试这个方法:
for Deleting Calllogs for particular number try this way:
public void DeleteCallLogByNumber(String number) {
String queryString="NUMBER="+number;
this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,queryString,null);
}
}
这篇关于如何从Android的删除通话记录编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文