当通话结束意图被解雇? [英] Intent to be fired when a call ends?
问题描述
我有一个已经构建的应用程序,我想添加一个功能,当有一个呼叫结束启动。 我怎样才能做到这一点? 我想声明我的清单像这样
I have an already built application and I want to add a feature that has to be started when a call ends. How can I achieve that? I thought that declaring in my manifest something like this
<activity android:name="Filter">
<intent-filter>
<category android:name="android.intent.SOMETHING" />
</intent-filter>
</activity>
可能是足够的,但什么样的意图
我已经把在过滤器?
could be enough, but what kind of Intent
I have to put on the filter?
看的文档中,我发现只有意图呼叫时开始检测。
Looking in the documentation I found only the intents that detects when a call is started.
是我要找的可能?
感谢
推荐答案
您可以使用<一个href="http://developer.android.com/intl/fr/reference/android/telephony/PhoneStateListener.html">PhoneStateLisenter听出了变化呼叫状态。
You can use the PhoneStateLisenter to listen out for changes in the call state.
所以,你听的<一个href="http://developer.android.com/intl/fr/reference/android/telephony/PhoneStateListener.html#LISTEN_CALL_STATE">LISTEN_CALL_STATE改变。
随着<一href="http://developer.android.com/intl/fr/reference/android/telephony/PhoneStateListener.html#onCallStateChanged%28int,%20java.lang.String%29">onCallStateChanged 方法。
因此,当从摘机状态变为空闲时启动应用程序
So when the state changes from OFFHOOK to IDLE start your application
这篇关于当通话结束意图被解雇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!