How can we hide call logs of specific contact in android?

别说谁变了你拦得住时间么 提交于 2020-01-01 07:08:15

问题


I am trying to hide call logs from particular contact. For this I have created broadcast receiver for receive event of incoming / outgoing / missed call / call hangup.

But how can I get call details on call hangup event ?

I know we can get following 2 informations when incoming event occurs :

1) State
2) Phone Number

Now for hide contact, I need to delete entry from defalut call log database which is located in “content://call_log/calls”., and insert it inside my sqlite database.

Is there anybody who faced this kind of issue before ? Any help will be appreciated.

Thanks.


回答1:


Perhaps a better approach would be to register a ContentOberver on the call log table. See this question: How to implement a ContentObserver for call logs

Whenever an update is made to the table, you could query for the phone number in question and delete the record.



来源:https://stackoverflow.com/questions/27024342/how-can-we-hide-call-logs-of-specific-contact-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!