0

In my application i need to dial some phone numbers. But when i am trying this the prompt like the below picture is coming. How i can avoid this? I need to dial using the native dialer app only.

enter image description here

My code to make the call to 'phoneNo' is

    Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:" + phoneNo));
    startActivity(callIntent);
Nithin Michael
  • 2,166
  • 11
  • 32
  • 56

1 Answers1

0

I think you need to do something like this which worked for me

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + phoneNo));
startActivity(callIntent);

ACTION_DIAL:

Activity Action: Dial a number as specified by the data. This shows a UI with 
the number being dialed, allowing the user to explicitly initiate the call. 

Hope it helps you.

Ok i got this answer

According to the API, ACTION_CALL will do what you need but not to emergency numbers, while ACTION_DIAL will display a dialer with the dial prompt but allows to call emergency numbers.

I'm afraid there is no way to do what you want, for a good reason - to prevent misdials to emergency services. It's a precautionary measure.

From here Dial Number Without Prompt

Ok and I think for what you wanted to perform you should atleast have one default Dialer in your Phone. Please check it.

Community
  • 1
  • 1
surhidamatya
  • 2,419
  • 32
  • 56