Android 通过提供GPS坐标,将Google导航启动到特定位置
我想知道是否可以通过从应用程序中提供特定位置的GPS坐标来启动Google导航到该位置。如果您的意思是要通过提供纬度和经度坐标从应用程序中启动Google逐圈导航,那么下面是代码:Android 通过提供GPS坐标,将Google导航启动到特定位置,android,navigationcontroller,Android,Navigationcontroller,我想知道是否可以通过从应用程序中提供特定位置的GPS坐标来启动Google导航到该位置。如果您的意思是要通过提供纬度和经度坐标从应用程序中启动Google逐圈导航,那么下面是代码: public void launchNavigation(){ String location = mLat + "," + mLng; Uri gmmIntentUri = Uri.parse("google.navigation:q="+location); Intent mapInten
public void launchNavigation(){
String location = mLat + "," + mLng;
Uri gmmIntentUri = Uri.parse("google.navigation:q="+location);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
基本上,在Uri参数中,您可以传递street address或Lat,Lng,如下所示:
google.navigation:q=a+street+address
google.navigation:q=latitude,longitude
我希望这能帮助有同样问题的人,因为我想你的问题早就解决了