0

我正在开发会议管理器应用程序。当用户单击特定配置文件时,dialConference将调用该函数。

 private void dialConference()

  {

    String str = "tel:";

    int i = 0;

    if (i >= this.confProfile.arrayValue.size())
    {
      startActivity(new Intent("android.intent.action.CALL", Uri.parse(str)));
      return;
    }
    ProfileDataValue localProfileDataValue = (ProfileDataValue)this.confProfile.arrayValue.get(i);
    if (i != 0)
    {
      if (localProfileDataValue.iDelay / 2 != 0)

        break label128;

      str = str + "%2C";
    }
    while (true)
    {
      localProfileDataValue.strValue = localProfileDataValue.strValue.replace("#", "%23");
      str = str + localProfileDataValue.strValue;
      i++;
      break;
      label128: int j = localProfileDataValue.iDelay / 2;
      for (int k = 0; k < j; k++)
        str = str + "%2C";
    }
  }
4

1 回答 1

1

此方法可以很好地在通话期间提供时间延迟并执行下一个号码。

private void call(int profileid){

            ProfileDo profile = adapter.getProfile(profileid);

            String call = "tel:";

            for (StepDO step : profile.getSteps()) {

                String value = URLEncoder.encode(step.getValue());

                int delay = step.getDelay();

                String pausesStr = "";

                for (int i = 0; i < delay/2; i++) {

                    pausesStr += PhoneNumberUtils.PAUSE;
                }
                call += value + pausesStr;


                System.out.println(""+call);
            }
            Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(call));

            startActivity(callIntent);
        }
    }
于 2013-08-14T09:48:02.650 回答