2013-01-19 64 views
0
btnCall.setOnClickListener(new OnClickListener() 
     { 
      public void onClick(View v) 
      { 
       Intent intentCall=new Intent(); 
       intentCall.setAction(android.content.Intent.ACTION_CALL); 
       intentCall.setData(Uri.parse("Calling no.."+edtText.getText())); 
       startActivity(intentCall); 
      } 
     }); 
+0

添加此,edtText.getText( )的ToString() – Aerrow

回答

0

這種嘗試,

Intent dial = new Intent(); 
    dial.setAction("android.intent.action.DIAL"); 
    dial.setData(Uri.parse("tel:"+edtText.getText().toString())); 
    startActivity(dial); 
0
Intent callIntent = new Intent(Intent.ACTION_CALL); 
callIntent.setData(Uri.parse("tel:"+edtText.getText().toString())); 
startActivity(callIntent); 

給你的應用程序的權限在AndroidManifest調用

<uses-permission android:name="android.permission.CALL_PHONE" />