Call forwarding
I would like to forward all calls to my number on to the new predefined number automatically. Is it possible to forward incoming call ?
Probably it is possible for Froyo at least. I found application called Easy Call Forwarding. http://www.appstorehq.com/easycallforwarding-android-189596/app But many people reckon it doesn't work actually.
We can notice forwarded call by onCallForwardingIndicatorChanged()
from PhoneStateListener
but
I have no idea how to set forwardi开发者_运维问答ng mode.
I explored on the net and got the answer to my question that how one can forward a call programmatically. Add these lines of code and one will be able to achieve it.
String callForwardString = "**21*1234567890#";
Intent intentCallForward = new Intent(Intent.ACTION_DIAL); // ACTION_CALL
Uri uri2 = Uri.fromParts("tel", callForwardString, "#");
intentCallForward.setData(uri2);
startActivity(intentCallForward);
Here 1234567890 represents the phone number. Add the approriate phone number as you wish here. One can dial ##21# to deactivate the service.
My solution:
Intent intent = new Intent(Intent.ACTION_CALL);
String prefix = "#31#";
prefix = Uri.encode(prefix);
intent.setData( Uri.parse("tel:"+prefix+"123456"));
startActivity(intent);
精彩评论