Android检查呼叫转移是否已激活 [英] Android Check if call forwarding is activated

查看:202
本文介绍了Android检查呼叫转移是否已激活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个呼叫转移应用程序,并已使用** 21 * xxxxxx#ussd代码使用ACTION_CALL Intent来激活呼叫转移.但是我还没有找到检查呼叫转移是否处于活动状态的解决方案.

I am building a call forwarding application and have used the **21*xxxxxx# ussd code to activate call fowarding using ACTION_CALL Intent. But I have not found a solution to check whether Call forwarding is active or not.

是否有任何解决方案可以从android系统检查呼叫转移是否处于活动状态?

Is there any solution to check from the android system if call forwarding is active or not?

推荐答案

您可以让Brodcast类对其进行注册,并且可以跟踪呼叫

you can make Brodcast class register it and you can track out going call like

public class CallBroadcastReceiver extends BroadcastReceiver
{
    public static String numberToCall;
    public void onReceive(Context context, Intent intent) {
        Log.d("CallRecorder", "CallBroadcastReceiver::onReceive got Intent: " + intent.toString());
        if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
            numberToCall = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
            Log.d("CallRecorder", "CallBroadcastReceiver intent has EXTRA_PHONE_NUMBER: " + numberToCall);
        }

    }
}

这篇关于Android检查呼叫转移是否已激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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