Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何通过'#';安卓系统中字符到动作的拨号意图_Android - Fatal编程技术网

Android 如何通过'#';安卓系统中字符到动作的拨号意图

Android 如何通过'#';安卓系统中字符到动作的拨号意图,android,Android,我想将一个包含“#”的数字传递到Android系统的拨号板。就像我使用的以下代码: Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:#123456#")); mContext.startActivity(intent); 但实际上,拨号盘上显示的号码是“123456”;“#”已经不见了。 我找不到导致此问题的原因,有人能帮我吗?试试看 Intent intent = new Intent(Intent.ACTION_D

我想将一个包含“#”的数字传递到Android系统的拨号板。就像我使用的以下代码:

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:#123456#"));
mContext.startActivity(intent);
但实际上,拨号盘上显示的号码是“123456”;“#”已经不见了。 我找不到导致此问题的原因,有人能帮我吗?

试试看

Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.fromParts("tel", "#123456#", "#")); 
startActivity(intent); 
试试这个

Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.fromParts("tel", "#123456#", "#")); 
startActivity(intent); 
试试看:

Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" + Uri.encode("#123456#"));

mContext.startActivity(intent);

尝试:

Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" + Uri.encode("#123456#"));

mContext.startActivity(intent);

如果您想拨打一个号码(例如:#123),您可以尝试以下方法:

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + Uri.encode("#123")));
startActivity(callIntent);
如果您想拨打像#123这样的号码,只需修改目的:

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + Uri.encode("#123")));
startActivity(callIntent);

如果您想拨打一个号码(例如:#123),您可以尝试以下方法:

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + Uri.encode("#123")));
startActivity(callIntent);
如果您想拨打像#123这样的号码,只需修改目的:

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + Uri.encode("#123")));
startActivity(callIntent);