0

From my Android application, I need to open the location sharing page of Google Maps. I can launch the google maps application using following code snippet,

Intent mapIntent = new Intent(Intent.ACTION_VIEW);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

or

Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:latitude,longitude?z=zoom"));
startActivity(mapIntent);

What should I do to launch the "Location Sharing" page(refer the image below) Google maps?

enter image description here

remya thekkuvettil
  • 778
  • 1
  • 7
  • 22
  • Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:latitude,longitude?z=zoom")); startActivity(mapIntent); this is better because here your sharing your exact information with details – Shubham Jain Oct 06 '17 at 05:16
  • That's ok. But I need a solution to launch the location sharing page – remya thekkuvettil Oct 06 '17 at 05:40

1 Answers1

-1

Check below code. This is from google's guideline.

    Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

Check below link for more help : https://developers.google.com/maps/documentation/urls/android-intents

Samir Bhatt
  • 3,041
  • 2
  • 25
  • 39