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

后端 未结 1 998
情深已故
情深已故 2020-12-19 09:27

I registered a PendingIntent to requestLocationUpdates(provider, minTime, minDistance, PendingIntent). But when my broadcast receiver receives this intend, how do I remove t

相关标签:
1条回答
  • 2020-12-19 09:38

    You create an equivalent PendingIntent. In other words, create an Intent that matches the one you used originally (though you can skip any extras), wrap that in the same sort of PendingIntent that you used originally, and use that PendingIntent in the removeUpdates() call.

    0 讨论(0)
提交回复
热议问题