【发布时间】: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);
}
【问题讨论】:
-
我建议您使用我的库,它会为您创建查询并解析可以轻松使用的输入数据:github.com/perezdidac/google-directions-api
标签: android google-maps android-intent uri