【问题标题】:Google Map not dropping pin with intent谷歌地图没有故意丢针
【发布时间】:2019-12-04 13:24:29
【问题描述】:

我正在使用 Implicit Intent 在 Google 地图中打开一个位置。有什么方法可以在该位置放置图钉吗?

这是我的代码:

Uri geoLocationUri = Uri.parse("geo:" + 0 + "," + 0 + "q?=" + focalPoint.getY() + "," + focalPoint.getX() );
Intent googleMapIntent = new Intent(Intent.ACTION_VIEW, geoLocationUri);
googleMapIntent.setPackage("com.google.android.apps.maps");
startActivity(googleMapIntent);

【问题讨论】:

    标签: android android-intent


    【解决方案1】:

    您在查询中错误地放置了您的?,请尝试:

    Uri geoLocationUri = Uri.parse("geo:" + 0 + "," + 0 + "?q=" + focalPoint.getY() + "," + focalPoint.getX());
    

    Google Maps Location Search Intent docs for Android 供您参考。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 1970-01-01
      相关资源
      最近更新 更多