我正在创建一个会议管理应用程序,.I正在使用PhonenumberUtils.PAUSE()作为时间延迟,因为call.It只工作了几秒钟。我想让它暂停几秒钟,根据我的wish.How,我能帮我吗?
String telUri = "tel:" + 121 + PhoneNumberUtils.PAUSE + 4
+ PhoneNumberUtils.PAUSE + 6 ;
Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(telUri));
startActivity(callIntent);现在调用到121,没有任何时间延迟,它执行数字4,与6 .I相同,我可以给出121和4 .How的时间延迟吗?
发布于 2013-08-14 10:23:43
PhoneNumberUtils.PAUSE将等待2秒,而PhoneNumberUtils.PAUSe的值为",“。
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-09 06:55:18
这是一个拨号施令的问题,一次暂停所需的时间并不是真的在你的控制范围内,而是通常是2-3秒。如果你想要一个更长的暂停
另外,使用StringBuilder (内存原因)
String doublePause = PhoneNumberUtils.PAUSE + PhoneNumberUtils.PAUSE;
StringBuilder sb = new StringBuilder("tel:").append(121).append(doublePause).append(4).append(doublePause).append(6);
Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(sb.toString()));https://stackoverflow.com/questions/18141359
复制相似问题