LocationManager.RequestSingleUpdate 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| RequestSingleUpdate(String, PendingIntent) |
請使用指定提供者註冊一次位置更新,並使用待處理的意圖。 |
| RequestSingleUpdate(String, ILocationListener, Looper) |
使用指定的提供者和回撥,註冊一次位置更新。 |
| RequestSingleUpdate(Criteria, PendingIntent) |
使用標準註冊單一地點更新,並處於待定意圖狀態。 |
| RequestSingleUpdate(Criteria, ILocationListener, Looper) |
使用條件和回撥註冊一次位置更新。 |
RequestSingleUpdate(String, PendingIntent)
請使用指定提供者註冊一次位置更新,並使用待處理的意圖。
[Android.Runtime.Register("requestSingleUpdate", "(Ljava/lang/String;Landroid/app/PendingIntent;)V", "GetRequestSingleUpdate_Ljava_lang_String_Landroid_app_PendingIntent_Handler")]
public virtual void RequestSingleUpdate(string provider, Android.App.PendingIntent pendingIntent);
[<Android.Runtime.Register("requestSingleUpdate", "(Ljava/lang/String;Landroid/app/PendingIntent;)V", "GetRequestSingleUpdate_Ljava_lang_String_Landroid_app_PendingIntent_Handler")>]
abstract member RequestSingleUpdate : string * Android.App.PendingIntent -> unit
override this.RequestSingleUpdate : string * Android.App.PendingIntent -> unit
參數
- provider
- String
由 #getAllProviders()
- pendingIntent
- PendingIntent
發送位置更新的待處理意圖
- 屬性
例外狀況
如果提供者是空的或不存在
若意圖為空
若無適當許可
備註
請使用指定提供者註冊一次位置更新,並使用待處理的意圖。
請參考 #requestLocationUpdates(long, float, Criteria, PendingIntent) 更多關於如何使用此方法的細節。
此會員已被棄用。 建議改用 #getCurrentLocation(String, CancellationSignal, Executor, Consumer) ,因為它不會有極端電池耗電的風險。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
RequestSingleUpdate(String, ILocationListener, Looper)
使用指定的提供者和回撥,註冊一次位置更新。
[Android.Runtime.Register("requestSingleUpdate", "(Ljava/lang/String;Landroid/location/LocationListener;Landroid/os/Looper;)V", "GetRequestSingleUpdate_Ljava_lang_String_Landroid_location_LocationListener_Landroid_os_Looper_Handler")]
public virtual void RequestSingleUpdate(string provider, Android.Locations.ILocationListener listener, Android.OS.Looper? looper);
[<Android.Runtime.Register("requestSingleUpdate", "(Ljava/lang/String;Landroid/location/LocationListener;Landroid/os/Looper;)V", "GetRequestSingleUpdate_Ljava_lang_String_Landroid_location_LocationListener_Landroid_os_Looper_Handler")>]
abstract member RequestSingleUpdate : string * Android.Locations.ILocationListener * Android.OS.Looper -> unit
override this.RequestSingleUpdate : string * Android.Locations.ILocationListener * Android.OS.Looper -> unit
參數
- provider
- String
由 #getAllProviders()
- listener
- ILocationListener
聆聽者接收位置更新
- looper
- Looper
處理監聽者回調的迴圈器,或用 null 來使用呼叫執行緒的迴圈器
- 屬性
例外狀況
如果提供者是空的或不存在
若 listener 為空
若無適當許可
備註
使用指定的提供者和回撥,註冊一次位置更新。
請參考 #requestLocationUpdates(String, long, float, LocationListener, Looper) 更多關於如何使用此方法的細節。
此會員已被棄用。 建議改用 #getCurrentLocation(String, CancellationSignal, Executor, Consumer) ,因為它不會有極端電池耗電的風險。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
RequestSingleUpdate(Criteria, PendingIntent)
使用標準註冊單一地點更新,並處於待定意圖狀態。
[Android.Runtime.Register("requestSingleUpdate", "(Landroid/location/Criteria;Landroid/app/PendingIntent;)V", "GetRequestSingleUpdate_Landroid_location_Criteria_Landroid_app_PendingIntent_Handler")]
public virtual void RequestSingleUpdate(Android.Locations.Criteria criteria, Android.App.PendingIntent pendingIntent);
[<Android.Runtime.Register("requestSingleUpdate", "(Landroid/location/Criteria;Landroid/app/PendingIntent;)V", "GetRequestSingleUpdate_Landroid_location_Criteria_Landroid_app_PendingIntent_Handler")>]
abstract member RequestSingleUpdate : Android.Locations.Criteria * Android.App.PendingIntent -> unit
override this.RequestSingleUpdate : Android.Locations.Criteria * Android.App.PendingIntent -> unit
參數
- criteria
- Criteria
包含選擇適當提供者以更新位置的參數
- pendingIntent
- PendingIntent
發送位置更新的待處理意圖
- 屬性
例外狀況
如果提供者是空的或不存在
若意圖為空
若無適當許可
備註
使用標準註冊單一地點更新,並處於待定意圖狀態。
注意:自 Android KitKat 起,Criteria 請求總是會使用 #FUSED_PROVIDER.
請參考 #requestLocationUpdates(long, float, Criteria, PendingIntent) 更多關於如何使用此方法的細節。
此會員已被棄用。 建議改用 #getCurrentLocation(String, CancellationSignal, Executor, Consumer) ,因為它不會有極端電池耗電的風險。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
RequestSingleUpdate(Criteria, ILocationListener, Looper)
使用條件和回撥註冊一次位置更新。
[Android.Runtime.Register("requestSingleUpdate", "(Landroid/location/Criteria;Landroid/location/LocationListener;Landroid/os/Looper;)V", "GetRequestSingleUpdate_Landroid_location_Criteria_Landroid_location_LocationListener_Landroid_os_Looper_Handler")]
public virtual void RequestSingleUpdate(Android.Locations.Criteria criteria, Android.Locations.ILocationListener listener, Android.OS.Looper? looper);
[<Android.Runtime.Register("requestSingleUpdate", "(Landroid/location/Criteria;Landroid/location/LocationListener;Landroid/os/Looper;)V", "GetRequestSingleUpdate_Landroid_location_Criteria_Landroid_location_LocationListener_Landroid_os_Looper_Handler")>]
abstract member RequestSingleUpdate : Android.Locations.Criteria * Android.Locations.ILocationListener * Android.OS.Looper -> unit
override this.RequestSingleUpdate : Android.Locations.Criteria * Android.Locations.ILocationListener * Android.OS.Looper -> unit
參數
- criteria
- Criteria
包含選擇適當提供者以更新位置的參數
- listener
- ILocationListener
聆聽者接收位置更新
- looper
- Looper
處理監聽者回調的迴圈器,或用 null 來使用呼叫執行緒的迴圈器
- 屬性
例外狀況
若條件為空
若 listener 為空
若無適當許可
備註
使用條件和回撥註冊一次位置更新。
注意:自 Android KitKat 起,Criteria 請求總是會使用 #FUSED_PROVIDER.
請參考 #requestLocationUpdates(long, float, Criteria, PendingIntent) 更多關於如何使用此方法的細節。
此會員已被棄用。 建議改用 #getCurrentLocation(String, CancellationSignal, Executor, Consumer) ,因為它不會有極端電池耗電的風險。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。