I want to forward any calls received to another predefined phone number. I have searched forums and found some contradictory answers. so i m confused.
First I looked
i think you need to try it on the device better than the emulator. You are using DTMF codes, so i think you need network (on the actual device) rather than on the emulator.
Dial the same code "**21*5556#" on your emulator and check. It does not work either! Replace the 5556 with the phone number you want to forward the call to and then try it on phone.
Meaning, the DTMF codes would work only on mobiles not on emulators or tablets without SIM support.
EDIT: you can find different call forwarding codes here.
Remove the "#" from Uri uri2 = Uri.fromParts("tel", callForwardString, "#"); if that do not work then try just *21*number#