Android: Redirect outgoing calls

后端 未结 1 653
失恋的感觉
失恋的感觉 2020-12-25 08:55

I\'m trying to redirect outgoing calls to a different phone number on an Android device. So, I use a BroadcastReceiver "listening" for the NEW_OUTGOING_CA

1条回答
  •  醉梦人生
    2020-12-25 09:18

    I cut the dialed call and redialed the new call. It worked perfectly on the device.

    This is the code part:

    setResultData(null);
    Uri uri = Uri.fromParts("tel", "!Number to be dialed!", null);
    Intent newIntent = new Intent(Intent.ACTION_CALL, uri);
    newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(newIntent);
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题