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);
            }
        });
4

2 回答 2

0

试试这个,

 Intent dial = new Intent();
    dial.setAction("android.intent.action.DIAL");
    dial.setData(Uri.parse("tel:"+edtText.getText().toString()));
    startActivity(dial); 
于 2013-01-19T07:49:14.363 回答
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" />
于 2013-01-19T08:01:47.317 回答