Sorin Trimbitas
Sorin Trimbitas

Reputation: 1497

Call without pressing the call button

I start a call intent like this :

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

but instead of directly calling that number I see the calling screen with the number prefilled and I have to press the call button in order to call. Is it possible to call directly without having to press the call button?

Thanks

Upvotes: 2

Views: 830

Answers (2)

Raghav Sood
Raghav Sood

Reputation: 82533

You can dial number by using the CALL_PHONE permission. For other, privileged, numbers use the CALL_PRIVILEGED permissison.

Upvotes: 1

IAmGroot
IAmGroot

Reputation: 13855

Add this to your manifest. It will allow you to call a phone without prompt

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

CALL_PHONE: Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.

Which can be found here:

http://developer.android.com/reference/android/Manifest.permission.html

Upvotes: 2

Related Questions