Skip to content Skip to sidebar Skip to footer

Android: How To Cancel A Request Of Location Update With Intent?

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

Solution 1:

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.


Post a Comment for "Android: How To Cancel A Request Of Location Update With Intent?"