用户结束对话后立即阅读通话记录 [英] Reading call log as soon as user ends a conversation

查看:99
本文介绍了用户结束对话后立即阅读通话记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将所有传入和传出的呼叫详细信息存储在已拨打或已接收号码的文件中,呼叫持续时间和时间。



我尝试了android呼叫日志API的阅读通话记录,但只有当我的应用程序正在运行且处于前台时才会发生。



我想在用户结束对话后立即阅读通话记录(可能是来电或去电)。为了达到这个目的,我注册了一个广播接收器,它监听电话状态的变化,每当用户结束谈话时我都会在onReceive()中读取callog。



任何人都可以告诉我有没有更好的方法呢。



用一句话来说: - 是否有任何广播接收机来监听呼叫日志内容的变化provider?

I am trying to store all incoming and outgoing call details in a file with number dialed or received,call duration and time.

I tried android call log API's to read call log but that happens only when my app is running and in foreground.

I want to read the call log as soon as user ends a conversation(may be incoming or outgoing call). To achieve this I am registerng a broadcast receiver which listens for phone state change and whenever user ends conversation I will read callog in onReceive().

Can any one please tell me, Is there any better approach for this.

To put it in a short sentence:- Is there any broadcast receiver to listen for the change to the call log content provider?

推荐答案

您是否尝试过观察CallLog URI? http://developer.android.com/reference/android/provider/CallLog.html [ ^ ]
Have you tried to observe CallLog URI? http://developer.android.com/reference/android/provider/CallLog.html[^]

这篇关于用户结束对话后立即阅读通话记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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