Skip to content

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

We can easily set/change the call forward number on gsm Android phones. Here i am showing you to change/set the call forward number for "Unconditional forwarding".

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! ๐Ÿ™‚

Dipin Krishna

Written by Dipin Krishna

Senior full-stack engineer with 15 years across Django, Laravel, SwiftUI and the infrastructure underneath. Available for contract work.

Work with me โ†’

Leave a note

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.