I'm trying to make a phone call from a service. The code I'm using is:
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + number));
startActivity(intent);
and it works well from within the main action, but not from the service. Error on the last line. Unable to call the service?
And how can I make this piece of code included in the main action?
source
share