1

我正在开发会议管理器应用程序。我正在使用 ACTION_CALL 功能拨打电话,使用 ACTION_DIAL 拨打号码。但是通话是分开的,拨号动作是分开的。有人可以帮我吗?这是我的代码

私人无效调用(int profileid){

    ProfileDo profile = adapter.getProfile(profileid);

    int stepCount = 0;
    long previousStepDelay = 0;
    for (StepDO step : profile.getSteps()) {
        Intent callIntent;

        String url = "tel:" + step.getValue();
        stepCount++;
        if (stepCount == 1) {

            callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
            startActivity(callIntent);

        } else {
            try {
                Thread.sleep(previousStepDelay * 1000);
                System.out.println("hai");

            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            callIntent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));

            startActivity(callIntent);

        }
        previousStepDelay = step.getDelay();

    }
}

}

4

0 回答 0