显示我的活动,而不是为来电标准画面我的、而不是、画面、标准

2023-09-12 22:20:36 作者:虐菜是享受

我正在开发针对Android 2.3.3的应用程序。它包含了一些EditView中的显示信息的来电:国家,当前时间,电话号码......我知道如何获取和显示信息。我所面临的问题是,我不知道如何表达我的活动的而不是的标准为来电屏幕。

I'm developing an application for android 2.3.3. It contains a few EditView's to show an information for an incoming call: country, current time, phone number... I know how to get and show that information. The problem I faced is that I don't know how to show my activity instead of the standard screen for incoming calls.

现在它显示的来电之后的信息。

Now it shows the information after the incoming calls.

怎么办呢?

推荐答案

这是不可能的。根据 PhoneApp 的用于启动InCallScreen被绑定到phoneapp的意图,你就没有机会拦截此。因此,屏幕上会显示每一次来。

It's not possible. According to the PhoneApp the intent used to start the InCallScreen is bound to the phoneapp, you have no chance to intercept this. So the screen will be shown every time.

你可能尝试做的是由 TelephonyManager 当手机进入 CALL_STATE_RINGING 状态,然后画你的UI刚过InCallScreen。也许可以这样做,但你woudn't能够摘机通话(不确定,但我不这么认为),从你的用户界面。也状态未设置时立即InCallScreen弹出,它延迟了一些毫秒。

What you may try to do is to be notified by the TelephonyManager when the phone goes into the CALL_STATE_RINGING state and then paint your UI just over the InCallScreen. It may be possible to do so but you woudn't be able to offhook the call (unsure, but I don't think so) from your UI. Also the state is not set immediately when the InCallScreen pops up, it's delayed by some milliseconds.