我想将我的号码的所有呼叫转发到新的预定义号码
自动。是否可以转接来电?
可能至少对Froyo来说是可能的。我找到了名为Easy Call Forwarding的应用程序。
http://www.appstorehq.com/easycallforwarding-android-189596/app
但是很多人认为它实际上并不起作用。
我们可以看到转发的电话 onCallForwardingIndicatorChanged()
从 PhoneStateListener
但
我不知道如何设置转发模式。
我在网上探索并得到了我的问题的答案,即如何以编程方式转发呼叫。添加这些代码行,就可以实现它。
String callForwardString = "**21*1234567890#";
Intent intentCallForward = new Intent(Intent.ACTION_DIAL); // ACTION_CALL
Uri uri2 = Uri.fromParts("tel", callForwardString, "#");
intentCallForward.setData(uri2);
startActivity(intentCallForward);
这里1234567890代表电话号码。根据需要添加适当的电话号码。可以拨打## 21#来停用该服务。
我的解决方案
Intent intent = new Intent(Intent.ACTION_CALL);
String prefix = "#31#";
prefix = Uri.encode(prefix);
intent.setData( Uri.parse("tel:"+prefix+"123456"));
startActivity(intent);