【发布时间】:2011-12-19 10:15:18
【问题描述】:
我需要使用 sdcard 上已经存在的 kml 文件打开谷歌地图。 (/sdcard/example.kml)
我试过了:
这个答案是错误的,当点击链接时,地图打开,但搜索位置“file:///sdcard/example.kml”
- 使用意图:
这段代码抛出ActivityNotFoundException:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("file:///sdcard/example.kml"));
startActivity(intent);
- 我尝试使用 setDataAndType 方法,但不起作用:
另一个ActivityNotFoundException:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
Uri.parse("file:///sdcard/example.kml"),
"application/kml");
startActivity(intent);
- 关于此问题的其他两个未解决的主题:
Open local KML File in Google Maps on Android
Does the Android API support KML files?
知道如何打开这个 kml 吗?
谢谢!!!
【问题讨论】: