1

我正在制作一个通过单击按钮拨打特定号码的应用程序,但是,如果该人有双卡,我希望能够让他选择使用哪个卡,因为它仅适用于一个服务提供商,

这是我到目前为止的代码,有没有办法检查是否有双卡,然后让用户选择从哪个卡调用?

我进行了搜索,发现最新的 API 内置了双卡支持,但是我的应用程序无法与 kitkat 一起使用

这是我的代码:

public void updateBalance(View view) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setData(Uri.parse(String.format("tel:%s", Uri.encode("*121#"))));
    startActivity(intent);
}

编辑

所以基本上我想做的是以下

public void updateBalance(View view) {
  if (dual sim){
    Intent intent = new Intent(Intent.ACTION_DIAL);
}
else{
   Intent intent = new Intent(Intent.ACTION_CALL);
}
intent.setData(Uri.parse(String.format("tel:%s", Uri.encode("*121#"))));
startActivity(intent);
}
4

1 回答 1

-1

我认为这取决于手机中的 sim 管理设置。

从上面的代码中,它正在移动到拨号盘。

在 Sim 管理设置 -> 默认设置 -> 语音通话中,单击它会打开一个对话框,显示 sim1、sim2,总是询问。基于这些设置,它将起作用

如果用户选择特定的 sim,如果用户选择总是询问选项,则不允许他们再次选择,那么它将显示选择 sim 的选项。

于 2015-11-24T11:27:33.943 回答