我制作了一个可以拨号的小应用程序。
拨号后,我等待自动应答机使用“;”结束其消息我在拨号字符串中输入的字符。
之后,我需要再次输入另一个字符串,这将是一个输入键“123456#”,我再次打算等待自动应答机结束其消息。
然后拨“0000#”
我面临的问题是最后一个字符串“0000#”没有出现在被叫号码显示中,因此没有拨号。我也尝试在字符串中给出 ',' 但它不起作用。
可能是什么问题。
protected void makeCall() {
Log.i("Make call", "");
EditText pnum = (EditText)findViewById(R.id.Primary_number);
EditText pwd = (EditText)findViewById(R.id.Key);
Intent phoneIntent = new Intent(Intent.ACTION_CALL);
//phoneIntent.setData(Uri.parse("tel:"+pnum.getText() + ";"+pwd.getText()));
phoneIntent.setData(Uri.parse("tel:36020198;123456789#;0000#"));
try {
startActivity(phoneIntent);
finish();
Log.i("Finished making a call...", "");
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MainActivity.this,
"Call faild, please try again later.", Toast.LENGTH_SHORT).show();
}
}
最佳答案
而不是使用字符串
phoneIntent.setData(Uri.parse("tel:36020198;123456789#;0000#"));
使用这个添加英镑符号:
phoneIntent.setData(Uri.parse("tel:36020198;123456789"+"%23"+";0000"+"%23"));
关于android - 拨号应用程序中的暂停等待功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26155507/