打算在通话结束时被解雇吗?
我有一个已经构建的应用程序,我想添加一个在通话结束时必须启动的功能。 我怎样才能做到这一点? 我认为在我的清单中声明这样的内容
<activity android:name="Filter">
<intent-filter>
<category android:name="android.intent.SOMETHING" />
</intent-filter>
</activity>
就足够了,但是我必须在过滤器上放置什么样的Intent
?
查看文档,我只发现检测呼叫何时开始的意图。
我正在寻找的可能吗?
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.
Is what I'm looking for possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经使用广播接收器完成了此操作。作品!代码如下 -
AndroidManifest.xml
IncomingCallTracker 代码片段如下 -
您可以在捆绑包中查找关键“状态”。当其值为“IDLE”时,表示呼叫已结束,您可以根据此执行您想要执行的任何操作。
I have done this using a broadcast receiver. Works! code looks like this -
AndroidManifest.xml
The IncomingCallTracker code snippet looks like -
You can look for the key 'state' in the bundle. When its value is 'IDLE' it means call has ended and you can perform whatever action you want to based on this.
您可以使用 PhoneStateLisenter 监听通话状态的变化。
因此,您会监听 LISTEN_CALL_STATE 更改。
使用 onCallStateChanged 方法。
因此,当状态从 OFFHOOK 更改为 IDLE 时,启动您的应用程序
You can use the PhoneStateLisenter to listen out for changes in the call state.
So you listen for the LISTEN_CALL_STATE change.
With the onCallStateChanged method.
So when the state changes from OFFHOOK to IDLE start your application