[英]how to give time delay during call in android?
I am working on conference manager application. 我正在处理会议管理器应用程序。 When user clicks particular profile , the dialConference
function will be called. 当用户单击特定配置文件时,将调用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";
}
}
This method is working fine to give the time delay during the call and executing next number. 此方法可以正常工作,以便在通话和执行下一个号码期间提供时间延迟。
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);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.