如何在android中暂停呼出呼叫直到验证
我需要暂停拨出的电话,直到输入正确的PIN。只有授权用户才能拨打电话。我使用了如何在android中暂停呼出呼叫直到验证,android,call,android-broadcastreceiver,Android,Call,Android Broadcastreceiver,我需要暂停拨出的电话,直到输入正确的PIN。只有授权用户才能拨打电话。我使用了BroadcastReceiver来检测传出呼叫 这是我的密码 public void onReceive(Context context, Intent intent) { String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER).toString(); //if u want to block particular call
BroadcastReceiver
来检测传出呼叫
这是我的密码
public void onReceive(Context context, Intent intent) {
String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER).toString();
//if u want to block particular call then check number or else block all call in thid code
if (worngPIN){
setResultData(null);//Canceling call operation
Toast.makeText(context, "This call is not Allowed", Toast.LENGTH_LONG).show();
}
}
我可以看到Toast
消息,但呼叫正在连接
我在5.1版中进行了测试。发布错误日志也发布错误日志