Java: Change the Call Forward Number on an Android phone programmatically

We can programmatically set/change the call forward number on gsm Android phones with ease.
Here i am showing you to change/set the call forward number for “Unconditional forwarding”.

The keypad code for Unconditional forwarding is: 21[phone number]#

String phone_number = "9999999999";
String key_code = "**21*" + phone_number + "#";
Intent intent = new Intent(Intent.ACTION_DIAL);
Uri uri = Uri.fromParts("tel", key_code, "#"); 
intent.setData(uri); 
startActivity(intent);

For other keypad codes see http://en.wikipedia.org/wiki/Call_forwarding#Keypad_codes.

Hope, it helps! 🙂

Leave a comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.