【问题标题】:send variable latitude longitude to google map direction?将可变纬度经度发送到谷歌地图方向?
【发布时间】:2013-10-10 07:46:24
【问题描述】:

我想将可变纬度经度传递给谷歌地图方向? 可以帮我查看错误或有新的解决方案吗? 这是我的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);
    }

【问题讨论】:

标签: android google-maps android-intent uri


【解决方案1】:

使用此代码,

最终意图意图=新意图(意图.ACTION_VIEW, uri.parse("http://maps.google.com/maps?" + "saddr=" + lat + "," + lon + "&daddr=" + 纬度 + "," +经度)); intent.setClassName("com.google.android.apps.maps", “com.google.android.maps.MapsActivity”); ((Activity) this).startActivity(intent);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多