i have a service that receives location updates every 1-3 seconds or so. the service is started from the main activity using a pending intent:
mFusedLocationClientFast.requestLocationUpdates(mLocationRequest, getPendingIntent());
where getPendingIntent()
is a method that defines an action for my IntentService
to handle in handleIntent()
however, a strange thing i noticed is that every time the IntentService
handles a location update in handleIntent()
, it's always immediately preceded by a call to onStartCommand()
of the same service.
does anyone know why onStartCommand()
needs to be called every time the service handles an intent?
thanks