I made a list with some restaurants in the first activity and what I want is to see in the googlemap the specific location of each restaurant I select every time.How can I pass these values from the first activity to the maps activity?
Asked
Active
Viewed 24 times
0
-
Hint: [`LatLng`](https://developers.google.com/android/reference/com/google/android/gms/maps/model/LatLng) is `Parcelable`. – Kevin Krumwiede Jun 08 '17 at 19:33
1 Answers
0
All you need to do is this (from the Google Map API documentation):-
// Create a Uri from an intent string. Use the result to create an Intent.
Uri gmmIntentUri = Uri.parse("google.streetview:cbll=46.414382,10.013988");
// Create an Intent from gmmIntentUri. Set the action to ACTION_VIEW
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
// Make the Intent explicit by setting the Google Maps package
mapIntent.setPackage("com.google.android.apps.maps");
// Attempt to start an activity that can handle the Intent
startActivity(mapIntent);

Zakir
- 2,222
- 21
- 31