我的代码是这样的:
public void onclickdial(View v) {
String str = "*#06#";
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+str)));
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show(); }
但是只有问题*拨号屏幕上会显示*符号:
答案 0 :(得分:1)
String str = "*#06#";
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.fromParts("tel", str, ","));
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show();
startActivity(callIntent);
或:
String str = "*#06#";
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+ Uri.encode(str))));
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show();