【发布时间】:2017-03-17 20:58:11
【问题描述】:
我正在尝试在我的应用程序中延迟设置呼叫转移选项。 就像我接到电话一样,它会显示 5 或 10 秒, 所以我知道,如果它来自我的家人或朋友,我可以接电话, 或者 否则延迟后会自动转发到设置的手机号码。
我已经写了下面的函数来设置。
帮我增加延迟,比如 5 秒或 10 秒。
void fwdCalSetSecBtnFnc()
{
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED)
{
Intent calFwdIntentVar = new Intent(Intent.ACTION_CALL);
String mobNumVar = FwdMobNumTxt.getText().toString();
String fwdMobNumVar = ("**21*" + mobNumVar + "#");
calFwdIntentVar.setData(Uri.fromParts("tel", fwdMobNumVar, "#"));
calFwdIntentVar.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(calFwdIntentVar);
}
}
【问题讨论】:
-
对于延迟使用系统时间...它会工作...
-
你也可以使用
Handler
标签: android call delay forward programmatically