Launching an Activity from a Service
- by nldev
When I am trying to launch a call activity from a Service, I get a NullPointerException. Here is my code:
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + number));
callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(callIntent);
I get the exception on the startActivity line.
I tried to…