In my application, I have created a service. Now from my service I want to fire an implicit intent shown below,
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("tel:" + "2125551212"));
if (intent.resolveActivity(getPackageManager()) != null) {
System.out.println("SENDING PHONE");
startActivity(intent);
}
code works without any error, in Logcat I can see launch is fired but no effect is there. No application is responding to this implicit intent.
Same code works when I do from Activity, it opens Phone App.
How can I fire implicit intent from Service?
Service is running in Background.