I want to launch Google Maps from my app with an explicit intent; I dont want to navigate to a point in the map or to show any particular place in the map -- I just want to launch Google Maps.
How can I do this? Whats the Intent for it?
I want to launch Google Maps from my app with an explicit intent; I dont want to navigate to a point in the map or to show any particular place in the map -- I just want to launch Google Maps.
How can I do this? Whats the Intent for it?
Use below code
String uri = "http://maps.google.com/";
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
It will open Google Map application.
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Uri gmmIntentUri = Uri.parse("geo:0,0?q=");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
}, 1000);
Use this above code in your button click or any other place you want to implement.