问题
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