我没有在android中拨号屏幕

时间:2013-01-19 07:45:54

标签: android

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

2 个答案:

答案 0 :(得分:0)

试试这个,

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

答案 1 :(得分: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" />