Im using Google Play Services, Fused Location Provider and LocationRequest to get the current location.
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setNumUpdates(1);
mLocationClient.requestLocationUpdates(mLocationRequest, this);
I would like to know how do I go about cancelling a request in progress? As stated by documentation when I call setNumUpdates() and pass 1, I must set an expiration which is fine while the app is running but what if I go to paused state? How can I explicitly cancel the request as the docs mention as soon as paused state occurs?
Thanks for reading