Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special characters for dialing

In Brazil, we use # to make some types of calls. For example, see the balance of a prepaid account phone, something like this: *222#

I use this code to call:

public static void doCall(Context context, String number) {
    Uri uri = Uri.parse("tel:" + number);
    Intent callIntent = new Intent(Intent.ACTION_CALL, uri);
    context.startActivity(callIntent);
}

Android removes # automatically? Has anyone experienced this?

Thanks, Mateus

like image 558
Mateus Avatar asked Dec 02 '25 06:12

Mateus


1 Answers

You need to URL-escape the '#', by using '%23' in its place:

tel:*222%23
like image 74
Andrew Aylett Avatar answered Dec 03 '25 21:12

Andrew Aylett



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!