“大众点评” Android App 的商家定位是使用的Google Map,当点击一个商家的地址时,系统会自动调用Google Map,并将商家方位显示出来,这是怎么做到的呢?
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://ditu.google.cn/maps?hl=zh&mrt=loc&q=31.1198723,121.1099877(上海青浦大街100号)");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
& Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://ditu.google.cn/maps?hl=zh&mrt=loc&q=31.1198723,121.1099877(上海青浦大街100号)");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
& Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);
本文介绍了一种在Android应用中通过发送Intent调用GoogleMap的方法,具体实现包括设置商家位置坐标和地址信息。
1465

被折叠的 条评论
为什么被折叠?



