Reputation: 7577
I am starting a service from a broardcast receiver like this:
Intent serviceIntent = new Intent(context, BarometricLogger.class);
context.startService(serviceIntent);
When I have finished doing the Work I am calling my cleanUp() method (it is from the service):
private void cleanUp()
{
sensorManager.unregisterListener(sensorListener);
locationManager.removeUpdates(locationListener);
isLocationSet = false;
isClean = true;
this.stopSelf();
}
The problem is that it doesn't look like the service is stopped because onDestroy() isn't called! What am I doing wrong?
BR
Upvotes: 2
Views: 3114
Reputation: 7577
ooops... that's almost embarrassing. It didn't stop because I accidentally put it into a never ending loop... :S
Upvotes: 1