0

我想将可变纬度经度传递给谷歌地图方向?可以帮我查看错误或有新的解决方案吗?这是我的java代码:

public void onClickShowMap(View v) {
      String latitude = ((TextView) findViewById(R.id.latitude)).getText().toString();
      String longitude = ((TextView) findViewById(R.id.longitude)).getText().toString();

    Intent intent = new Intent(android.content.Intent.ACTION_VIEW,          
    Uri.parse("http://maps.google.com/maps?f=d&daddr="+latitude+","+longitude));
    startActivity(intent);
    }
4

1 回答 1

0

使用此代码,

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(" http://maps.google.com/maps ?" + "saddr=" + lat + "," + lon + "&daddr=" + lattitude + "," +经度)); intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); ((活动) this).startActivity(intent);

于 2013-10-10T08:32:33.320 回答