How to call phone number ending with # using Android Dialer

后端 未结 2 453
情话喂你
情话喂你 2021-01-27 10:42

How do I call a number ending with \'#\' sign using android dialer?

My code is as follows,

EditText firstNumber;
Button btnAdd;


@Override
protected voi         


        
相关标签:
2条回答
  • 2021-01-27 11:34

    This is how you call a number ending with '#' using android dialer. You need to encode and then parse.

    Try the below code,

    String text = et.getText().toString();
    
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + Uri.encode("*221*" + text + "#")));
    startActivity(intent);
    
    0 讨论(0)
  • 2021-01-27 11:38

    Using this link you can get unicode and hex values

    for example 36 can be stored in strings.xml as

       <string name="abcd">&#51;&#54;</string>
    
    0 讨论(0)
提交回复
热议问题