Call in Android application shows add contact dial

2019-03-05 09:17发布

问题:

I'm using this code for calling, in Android application:

Intent callIntent = new Intent(Intent.ACTION_CALL);    
callIntent.setData(Uri.parse("tel:" + call.Number));   
startActivity(callIntent);

but I obtain a dialog like this:

Why no call is make?

P.s: I'm using a Tablet (Acer Iconia A501), not a smartphone.

回答1:

Try this

Make sure :

call to :

 startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" +mEditText_number.getText())));

Add permission:

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