Skip to content

Instantly share code, notes, and snippets.

@osama-raddad
Forked from ursimon/gist:6423907
Last active March 7, 2016 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osama-raddad/6ac763b04718e930f1c8 to your computer and use it in GitHub Desktop.
Save osama-raddad/6ac763b04718e930f1c8 to your computer and use it in GitHub Desktop.
Android launchGoogleMaps
private void launchGoogleMaps(String name, String vicinity) {
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?q="+name+","+vicinity));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); // this is the magic
startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment