Reputation: 1469
How can I make a call without taking user to dialer activity. Is there any way to do it? I have a requirement where i have to implement it auto without user interaction. I have below code which is taking me to dialer that i have to avoid.
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
Upvotes: 1
Views: 2710
Reputation: 1872
try like this.
Intent callIntent = new Intent(Intent.ACTION_CALL_BUTTON);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
i.e use ACTION_CALL_BUTTON insted of ACTION_CALL
Upvotes: 1