我要处理来电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);
}
}