Tom Dignan Tom Dignan - 2 months ago 8
Android Question

Why are '#' s in my extension not being dialed in Android?

Here is some code I am using to dial a phone number. It works fine, except for when I put a '#' in the extension. The ','s are to cause a delay before the extension is dialed. Why doesn't the '#' get dialed? Basically, any numbers after the # are just getting discarded.

String number = "555-555-5555,,1#123"
// # is not dialed, neither are 123
Intent intent = new Intent();
intent.setAction(Intent.ACTION_CALL);
Uri uri = Uri.parse("tel:" + number);
Log.d("URI", uri.toString());
intent.setData(Uri.parse("tel:" + number));
context.startActivity(intent);

Answer

You need to do String encodedHash = Uri.encode("#") to send it with ACTION_CALL.