***由于本的回答解決了***。
我必須在清單中為“POI”更改“導航”。
原始問題:
我正在對可能的 Android APP 進行“更新”,以包括地圖的“Android auto”服務。我已經在 DHU 和真實設備(汽車)上進行了測驗,一切正常,但是當我想啟動“谷歌地圖”或另一個“地圖應用程式”時,這段代碼應該打開它,但它不起作用。沒有錯誤,但“地圖應用程式”沒有啟動。
這是我使用的代碼,基于檔案https://developer.android.com/training/cars/apps#user-interaction進入“onclick 元素”
var myCoordinates = latitude "," longitude
val intent = Intent(CarContext.ACTION_NAVIGATE, Uri.parse("geo:" myCoordinates))
carContext.startCarApp(intent)
)
這是我的“清單”(android auto 部分)
// android auto
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
<meta-data
android:name="androidx.car.app.minCarApiLevel"
android:value="1"/>
<service
android:name=".programameudisservice"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
<category android:name="androidx.car.app.category.NAVIGATION"/>
**** 解決方案 *****
</intent-filter>
</service>
// android auto
“清單”中必須有任何特殊元素才能正確打開它?
提前致謝
uj5u.com熱心網友回復:
最近使用的導航應用程式是用于處理意圖的應用程式。我自己沒有嘗試過,但我懷疑,如果您的應用程式被歸類為導航應用程式,那么它就是接收意圖的應用程式。CarContext.ACTION_NAVIGATE
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/514745.html
上一篇:Google地圖上的附近搜索回傳INVALID_REQUEST
下一篇:谷歌靜態API大型縮放地圖
