我需要用这两个字符(逗号和哈希)制作自动电话呼叫应用程序。
我尝试用这个方法。如果是这样,则不会调用 hash 后面的所有字符。
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +"131#3131,,,44"));
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
所以,我再次尝试使用这个方法。那么,逗号后面的所有号码都不会被调用。我可以知道该怎么做吗?
Intent out = new Intent();
out.setAction(Intent.ACTION_DIAL);
out.setData(Uri.parse("tel:" + Uri.encode("+3943#333,,23")));
startActivity(out);
Run Code Online (Sandbox Code Playgroud)
小智 5
答案在这里(复制)
Uri.parse(String.format("tel:%s", Uri.encode(number)))
Run Code Online (Sandbox Code Playgroud)