0

我想从变量 edittext 或 textview 启动 Google Maps Directions 有人帮助我吗?这是我的java代码:

    StringBuilder stringbuilder = new StringBuilder("http://maps.google.com/maps?daddr=");
    double d = -6.559759;
    StringBuilder stringbuilder1 = stringbuilder.append(d).append(",");
    double d1 = 106.785973;
    Uri uri = Uri.parse(stringbuilder1.append(d1).toString());
    Intent intent = new Intent("android.intent.action.VIEW", uri);
    startActivity(intent);
4

1 回答 1

0

尝试这个-

   final Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://maps.google.com/maps?f=d&saddr="+currentLatitude+","+currentLongitude+"&daddr="+dest_Latitude+","+dest_Longitude));
            intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
            context.startActivity(intent);
于 2013-10-10T07:15:28.910 回答