我怎样才能显示一个CALL采用的是Android处理之前作出选择对话框? [英] How can I display a dialog box for making a choice before a CALL is processed in android?

查看:122
本文介绍了我怎样才能显示一个CALL采用的是Android处理之前作出选择对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拦截外拨电话,并将其传递给VoIP应用。我看到,谷歌语音应用程序的每个调用实际启动之前显示问题的功能。它为用户提供了选择

I would like to intercept outgoing calls and pass them to a VOIP application. I see that the Google Voice application has a feature for displaying a question before each call is actually initiated. It provides the user with the choice:


  • 通过谷歌语音启动呼叫

  • 启动通过标准的呼叫通话

我想办法做到我的申请类似的东西(所以,并非所有的呼叫都通过它进行路由)。此刻,我可以通过一个BroadcastReceiver拦截呼叫事件,但是,这些都不允许打开对话框(从而能够以显示的选择)。

I would like a way to do something similar with my application (so that not all calls have to be routed through it). At the moment, I can intercept CALL events via a BroadcastReceiver, however, these are not allowed to open dialogs (thus making it possible to display the choice).

什么是实现这一目标的最佳途径?

What is the best way of achieving this goal?

推荐答案

您的应用程序应该监听的意图:NEW_OUTGOING_CALL

Your application should listen for the intent : NEW_OUTGOING_CALL

检查此处的http://developer.android.com/reference/android/content/Intent.html#ACTION_NEW_OUTGOING_CALL

一旦你收到的意图在BroadcaseReceiver,与你的活动类的意图从而显示的对话框打电话给你的活动通过它。

And once you receive the intent in a BroadcaseReceiver, call your activity through it with your activity class intent which in turn displays the dialog.

这篇关于我怎样才能显示一个CALL采用的是Android处理之前作出选择对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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