地图的 android.content.Intent.ACTION_VIEW 无法使用还是我错了?

发布于 2024-09-30 02:36:38 字数 497 浏览 4 评论 0原文

我使用我的应用程序所做的就是允许用户在 Google 地图上发现 POI。 这真的很简单,我使用

final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:+"
    + lat+ ","
    + lon));
startActivity(myIntent);

这个我有 2 个大问题

1) 当激活纬度时,谷歌地图打开并显示我的位置而不是我的 POI 位置! 我必须退出 Google 地图并再次返回才能专注于我的 POI 位置。

2) 我的 POI 位置上没有标记!真可惜,如果我稍微移动地图,我的 POI 就会丢失。

那么我的问题是:你是否和我有同样的感受?有一些解决方法可以解决这个问题吗? (也许有其他意图)?

非常感谢您的帮助,我想我必须创建自己的 MapActivity,我认为对于这样一个小功能来说这是浪费时间。

What I do with my application is allowing users to discover POI on Google Maps.
That's really easy and I use

final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:+"
    + lat+ ","
    + lon));
startActivity(myIntent);

I have 2 big issues with this

1) When Latitude is activated, Google Maps open and show my location instead of my POI location!
I have to quit Google Maps and come back again to focus on my POI location.

2) There are no marker on my POI location! such a shame, if I move a little bit the Map, My POI is lost.

So my question are: do you have the same feeling than me with this intent? Is there some workaround to fix that? (maybe an other intent)?

Thank a lot for any help, I think I will have to create my own MapActivity and I think that's a waste of time for such a little feature.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感性不性感 2024-10-07 02:36:38

尝试:

最终意图 myIntent = 新意图(
android.content.Intent.ACTION_VIEW,
Uri.parse( "geo:0,0?q=" + lat + "," + lon )
);
startActivity(myIntent)

try:

final Intent myIntent = new Intent(
android.content.Intent.ACTION_VIEW,
Uri.parse( "geo:0,0?q=" + lat + "," + lon )
);
startActivity(myIntent)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文