我有一個問題讓谷歌地圖玩自動打開後...如何使用Intent打開和定向Google地圖?
例子:我已經把意圖代碼是的,它會打開谷歌地圖根據我的緯度和經度... 但是,我仍然需要按一個按鈕啓動谷歌地圖來指導我。 如何在沒有用戶按下的情況下打開Google Map後自動打開Google Map?可能嗎 ?
這裏是我的代碼,
private void turnOnMap()
{
String labelMap = "Target";
String geouri = "geo:0,0?q=-6.908572,107.610923(XXI)";
Intent mapInt = new Intent(Intent.ACTION_VIEW, Uri.parse(geouri));
startActivity(mapInt);
}
我從這些 open google maps through intent for specific location in android 和Android - How to launch Google map intent in android app with certain location, zoom level and marker的意圖代碼的一些信息,並從Android官方網站https://developer.android.com/guide/components/intents-common.html#Maps
也最新的URI和,他們沒有解釋我應該添加什麼命令來打開後自動播放谷歌地圖...
希望你能幫助我的傢伙...非常感謝你的喲烏爾時間和信息
怎麼樣[官方文檔(https://developers.google.com/maps/documentation/urls/android-intents#launch_turn-by-turn_navigation)? – Eselfar
也許您應該閱讀[Google地圖網址](https://developers.google.com/maps/documentation/urls/guide#directions-action)。 – xomena
我知道它的夥伴...這裏我們去https://developers.google.com/maps/documentation/urls/android-intents#launch_turn-by-turn_navigation 謝謝@Eselfar您的建議..作品;) 和xomena的更多詳細信息穀歌地圖API –