initiate a phone call on android with special character #
I use the following code to launch a call from within the android app:
intent.setData(Uri.parse("tel:+12345 #123"));
startActivity(intent);
While it starts the call, it ignores everything starting with the #.
I read something about modifying SpecialCharSequenceMgr.java file, but I can't find this anywhere and quite honestly don't know what exactly one has to do. What is the best way to solve this?
I believe the problem is the that the # symbol has a special meaning in URIs, so you have to encode it using the Uri.encode()
method like this:
Intent out = new Intent();
out.setAction(Intent.ACTION_DIAL);
out.setData(Uri.parse("tel:" + Uri.encode("+12345#123")));
startActivity(out);
I believe that Jon is not completely right on your question, the idea was not so bad, though... You need to use special character map to initiate pound key:
Intent intcall = new Intent(Intent.ACTION_CALL);
intcall.setData(Uri.parse("tel:5555" + "%23"+"additional number"));
startActivity(intcall);