我在第一个活动中列出了一些餐馆,我想要的是在googlemap中看到我每次选择的每家餐馆的具体位置。我如何将这些值从第一个活动传递给地图活动?
答案 0 :(得分: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);