如何清除您的通话记录历史的Andr​​oid? [英] How do you clear your call logs history in android?

查看:156
本文介绍了如何清除您的通话记录历史的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么能清除整个通话记录历史的Andr​​oid?目前,我有这个code只能清除特定的通话记录

 公共无效DeleteCallLogByNumber(串号){
    字符串的queryString =NUMBER =+号;
    。this.getContentResolver()删除(CallLog.Calls.CONTENT_URI,的queryString,NULL);
    }
}


解决方案

我能与此做到这一点,它已经有一段时间虽然。不知道这是否仍然有效。

  getContentResolver()删除(android.provider.CallLog.Calls.CONTENT_URI,NULL,NULL);

编辑:请注意,我不能肯定用于应用程序平台设计者能够删除通话记录的看到这个开发博客文章。因此,虽然这样做在技术上的工作,请以此为公平的警告,它可能在任何时候改变和打破你正在试图建立。

How can you clear the entire call log history in android? Currently i have this code that can only clear a particular call log

public void DeleteCallLogByNumber(String number) {   
    String queryString="NUMBER="+number; 
    this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,queryString,null);
    }  
}

解决方案

I was able to do it with this, It's been a while though. Not sure if this still works.

getContentResolver().delete(android.provider.CallLog.Calls.CONTENT_URI, null, null) ;

EDIT: Please note I am not certain that the platform designers intended for apps to be able to delete the call log See this dev blog post. So while this does technically work please take this as a fair warning that it may at any point change and break what you are trying to build.

这篇关于如何清除您的通话记录历史的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆