1
我試圖在延遲時間內在我的應用中設置呼叫轉移選項。 像我接到電話,它顯示5或10秒, 所以我看到,如果它從我的家人或朋友我可以選擇的電話, 或 其他的延遲後,它應該自動轉發到設置的手機號碼。Android:在延遲後設置呼叫轉移
我寫了下面的函數來設置。
幫助我添加延遲,如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' –