2013-08-06 36 views
0

我是新來的android和工作在會議管理器應用程序。我不知道如何訪問撥號在Android的電話啓動後付款可以有人幫助我在這種情況下,或提供一些示例代碼作爲我的參考。謝謝。這是我的電話()的第一個數字應該會議號碼,所以我用行動呼籲,第二個數字是一個會議腳,每一步都會有延時如何在android中啓動通話後撥號訪問代碼?

私人無效調用(INT簡檔){

ProfileDo profile = adapter.getProfile(profileid); 

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


     String url = "tel:" + step.getValue(); 
     stepCount++; 
     if (stepCount == 1) { 
      Intent callIntent = null; 
      callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(url)); 
      startActivity(callIntent); 
     } else { 
      try { 
       Thread.sleep(previsouStepDelay*1000); 
      } catch (InterruptedException e) { 
       e.printStackTrace(); 
      } 
      Intent callIntent = null; 
      callIntent = new Intent(Intent.ACTION_DIAL, Uri.parse(url)); 
      //callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
      startActivity(callIntent); 

     } 
     previsouStepDelay = step.getDelay(); 

    } 
} 

誰能告訴我我做了什麼錯誤,我該如何即興創作?

回答

0

使用下面意圖打開撥號畫面..

Intent intent = new Intent(Intent.ACTION_DIAL); 
startActivity(intent); 

reference

+0

我有兩個步驟,第一步是電話號碼和第二步數是撥號盤number.How我可以做這個? – user2656259

相關問題