I am trying to open Google Maps(for turn-by-turn navigation) inside a class that extends "service" instead of activity. The code I got from the google developer guide as below works fine with activity, but not service. I really need to open Google Maps from my app that stays in the background. Can somebody help me?
Uri gmmIntentUri = Uri.parse("geo:0,0?q=-33.8666,151.1957(Google+Sydney)");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
Trying to use the above code inside:
public class myClass extends Service {
...
}