gpt4 book ai didi

android - 使用 Intent 调用谷歌地图时抑制选择器对话框

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:36:27 25 4
gpt4 key购买 nike

我想在不显示“完成操作对话框”的情况下调用 google map intent?

这可能吗?这是我的代码。

String uri = "http://maps.google.com/maps?saddr=" + Utils.getLatitude(ShowDetails.this)+","+Utils.getLongitude(ShowDetails.this)+"&daddr="+userLatitude+","+userLongitude;
startActivity(new Intent(android.content.Intent.ACTION_DEFAULT, Uri.parse(uri)));

我不想在调用 google map intent 时显示下面的对话框。感谢任何帮助。

enter image description here

最佳答案

下面的代码帮助我解决了我的问题。

String uri = "http://maps.google.com/maps?saddr=" + Utils.getLatitude(ShowDetails.this)+","+Utils.getLongitude(ShowDetails.this)+"&daddr="+userLatitude+","+userLongitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);

关于android - 使用 Intent 调用谷歌地图时抑制选择器对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8132069/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com