处理来电的机器人编程 [英] Handling incoming call in android programming

查看:100
本文介绍了处理来电的机器人编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要处理来电android平台。 其实我想设定一个时间段中, 如果我的手机收到来电后自动 消息发送给每个人。

i want to handle incoming call android platform. actually i want to set a time duration in which if my cell phone receive any call then automatically a message send to each of them.

请帮我。

推荐答案

喜只是扩展乌尔班PhoneStateListener并覆盖onCallStateChanged方法和样本code如下

hi Just extend ur class to PhoneStateListener and override onCallStateChanged method and sample code follows

class myCallListener extends PhoneStateListener{

        @Override
        public void onCallStateChanged(int state, String incomingNumber) {
            // TODO Auto-generated method stub
            switch (state) {
            case TelephonyManager.CALL_STATE_RINGING:
                    // your logic here
                break;

            default:
                break;
            }

            super.onCallStateChanged(state, incomingNumber);

        }
    }

这篇关于处理来电的机器人编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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