Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Call in Android Application using default call application

I am using following code to make a call from my android application:

Intent intent = new Intent(Intent.ACTION_CALL);                 
intent.setData(Uri.parse("tel:9898989898"));
startActivity(intent);

This opens Intent Chooser if Skype is installed in phone. What i want is it should directly make call from default call application.

How can I achieve this?

like image 402
Unnati Avatar asked Apr 22 '14 06:04

Unnati


1 Answers

Use intent.setPackage("com.android.phone");

Like

Intent intent = new Intent(Intent.ACTION_CALL);  
intent.setPackage("com.android.phone");               
intent.setData(Uri.parse("tel:9898989898"));
startActivity(intent);

But better is to let the user to choose.

Read more at How to call from Android Native Dialers, ignore other dialers

like image 163
Pankaj Kumar Avatar answered Nov 16 '22 02:11

Pankaj Kumar