問題描述
我在 onAddGeofencesResult(int statusCode, String[] geofenceRequestIds)
回調(diào)中遇到錯誤,其中 statusCode = 1000
.
I am getting an error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds)
callback with statusCode = 1000
.
我已啟用 GPS 和 WiFi.我也有 Google Play 服務(wù),我可以跟蹤我的位置并請求更新.為什么我無法添加地理圍欄?即使從文檔示例應(yīng)用程序中,我也無法添加地理圍欄.我收到以下 Toast 消息:
I have my GPS enabled and my WiFi. I also have Google Play Services and I am able to track my location and request updates. Why am I not able to add geofences? I am not able to add geofences even from the documentation sample app. I get the following Toast message:
添加地理圍欄:失敗,錯誤代碼 1000 GeofenceRequestIds=[1,2,1,2]"
"Add Geofences: Failure, error code 1000 GeofenceRequestIds=[1,2,1,2]"
來自文檔(statusCode 1000):
From the documentation (statusCode 1000):
public static final int GEOFENCE_NOT_AVAILABLE
地理圍欄服務(wù)現(xiàn)在不可用.通常這是因為用戶在設(shè)置中關(guān)閉了位置訪問權(quán)限 >位置訪問.
Geofence service is not available now. Typically this is because the user turned off location access in settings > location access.
常數(shù)值:1000 (0x000003e8)
Constant Value: 1000 (0x000003e8)
推薦答案
當(dāng)用戶在 Settings->Location- 中不同意使用 Google 位置服務(wù)"時,您會得到 GEOFENCE_NOT_AVAILABLE
(code '1000')>模式:
You get GEOFENCE_NOT_AVAILABLE
(code '1000') when user disagrees to "Use Google' location services" in Settings->Location->Mode:
修復(fù)它:
- 進(jìn)入設(shè)置->位置->模式
- 設(shè)置僅限設(shè)備(使用 GPS 確定您的位置)"
- 設(shè)置任何其他選項以獲取彈出窗口(例如高精度(使用 GPS、Wi-Fi 和移動網(wǎng)絡(luò)確定位置")
- 顯示使用 Google 的位置服務(wù)"對話框
- 選擇同意"
這篇關(guān)于在 Android 中添加地理圍欄時出錯(狀態(tài)碼 1000)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!