android - 具有特定语言的谷歌地图意图
问题描述
我想用特定语言(如英语、印地语、卡纳达语等)打开谷歌地图。是否可以在用于谷歌地图意图的 URI 中发送语言环境?
我正在使用以下代码打开谷歌地图,
val muri = "google.navigation:q=" + pickupLatitude + "," + pickupLongitude + "&mode=l"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(muri))
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(intent)
遵循以下解决方案,但它不起作用
String uri = String.format(Locale.ENGLISH, "http://maps.google.com/maps?
saddr=%f,%f(%s)&daddr=%f,%f (%s)", sourceLatitude, sourceLongitude, "Home Sweet Home",
destinationLatitude, destinationLongitude, "Where the party is at");
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
intent.setPackage("com.google.android.apps.maps");
startActivity(intent);
解决方案
推荐阅读
- python - Flask Redirect 仅在刷新页面时有效
- c# - c# 队列值无意中改变
- angular - angular 5 httpclient ,在 post 上,响应不返回自定义标头,仅返回响应对象
- reactjs - 重置而不清除 syncErrors
- vue.js - 在 Vue 单元测试中单击按钮时触发表单提交
- excel - 将彭博公式插入单元格
- selenium - appium 会话未在 appium 桌面中捕获
- r - R Blogdown:使用knitr并排插入图像
- php - 编写动态复选框列表,如何提交复选框?
- java - 在没有主节点的android中从JSON生成listview?