簡體   English   中英

Android:如何取消有意圖的位置更新請求?

[英]Android: how to cancel a request of Location update with intent?

我在requestLocationUpdates(provider,minTime,minDistance,PendingIntent)中注冊了PendingIntent。 但是當我的廣播接收器收到此打算時,如何使用removeUpdates(PendingIntent)刪除此請求? 接收方不保留對原始PendingIntent的引用。

您創建一個等效的PendingIntent 換句話說,創建一個Intent匹配您最初使用(盡管你可以跳過任何額外消費)之一,包裹,在同一類PendingIntent您最初使用,使用PendingIntentremoveUpdates()調用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM