2017-06-08 7 views
0

最初のアクティビティでいくつかのレストランのリストを作ったので、毎回選択する各レストランの特定の場所をgooglemapで見たいと思っています。これらの値を最初のアクティビティからマップアクティビティに渡すことはできますか?私は1つのアクティビティからもう1つのアクティビティのlatlng値をアンドロイドに渡したい

+0

ヒント:[ 'LatLng'](https://developers.google.com/android/reference/com/google/ android/gms/maps/model/LatLng)は 'Parcelable'です。 –

答えて

0

すべてを行う必要がある(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);