简体   繁体   中英

Android Intent.ACTION_CALL with a calling card

I'm trying to call a complex number with the ACTION_CALL intent, similar to a calling card. It looks something like this: (Calling card phone number, calling card pin, actual number to dial.)

Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:18005551234,987654#,14325558765");
startActivity(callIntent);

However, when the dialer comes up, it only dials the 800 number at the start of the sequence and ignores the rest.

How can I get it to dial the entire number?

It appears this works if you encode the number.

String num = "tel:"+Uri.encode("18005551234,987654#,14325558765");

Note that including "tel:" inside the Uri.encode() call also encodes the :, which breaks the URI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM