How to make android dial the # key?

Viewed 39

My application can dial any number but if I add the # key to the string to call then the number gets truncated just before the #. For example

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + "131*4#23"));
startActivity(callIntent);

The "131*4#23" is just to test the code. I will be using # key in the main application but it is not working. What can I do?

NOTE: I have handled the permission and all the other numbers are working.

1 Answers
callIntent.setData(Uri.parse(String.format("tel:%s", Uri.encode("131*4#23"))));
Related