Android 调用系统地图(Google Map)并显示具体方位

来源:互联网 发布:vb机器视觉编程 编辑:程序博客网 时间:2024/04/26 08:32

“大众点评” 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);

原创粉丝点击