The Android program calls native GoogleMap, passing the start and end positions, generating a roadmap
Copy Code code as follows:
if (wodeweizhipoint!= null) {
if (wodeweizhipoint.getlatitudee6 ()!= 0) {
float Chufajingdu = (float) (Wodeweizhipoint.getlongitudee6 ()/1E6);
float Chufaweidu = (float) (Wodeweizhipoint.getlatitudee6 ()/1E6);
float Daodajingdu = (float) (AppConstant.PointZuoBiao.liangxiangDaoHangPoint.getLongitudeE6 ()/1E6);
float Daodaweidu = (float) (AppConstant.PointZuoBiao.liangxiangDaoHangPoint.getLatitudeE6 ()/1E6);
Mark a Point
Intent i = new
Intent (Intent.action_view,uri.parse ("http://ditu.google.cn/maps?hl=zh&mrt=loc&q=31.249351,121.45905") ));
The route from where to where
Intent i = new Intent (Intent.action_view,uri.parse ("http://ditu.google.cn/maps?f=d&source=s_d&saddr=")
+ Chufaweidu
+ ","
+ Chufajingdu
+ "&daddr="
+ Daodaweidu
+ ","
+ Daodajingdu + "&hl=zh"));
If the GoogleMap map client is forced to open, add the following two sentences
I.addflags (intent.flag_activity_new_task& intent.flag_activity_exclude_from_recents);
I.setclassname ("Com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
StartActivity (i);
}
} else {
Alertutils.toastalert (Mcontext, "cannot provide navigation" because it cannot get to your location);
}