map.pause() stopping LocationService with 10.2 SDK

3188
1
Jump to solution
12-20-2013 07:10 AM
Town_ofSnowflake
Occasional Contributor
I have an app in which I want the LocationService to remain running even if onPause() is called.  I have a service running in the foreground with a handler & broadcast receiver that is bound to an activity.  The service/activity work together to updates a trackline at an X time interval, both on the map & in a SQLLITE database on the device.

When I call map.pause() in the onPause() method, the locationservice stops listening for location change until I unpause the map again in onResume().

I initialize the LocationService using map.getlocationservice(), so it makes sense that it would stop the LocationService, but I don't want this to happen.

Is there a work around for this?  Or perhaps something I'm not understanding correctly?
0 Kudos
1 Solution

Accepted Solutions
Town_ofSnowflake
Occasional Contributor
I was creating my LocationListener through the LocationService, which came from the map object.  Of course the LocationListener would be pausing when I pause the map.

Solution: I moved my LocationListener to the Service & am now broadcasting location updates back to the map activity.

View solution in original post

0 Kudos
1 Reply
Town_ofSnowflake
Occasional Contributor
I was creating my LocationListener through the LocationService, which came from the map object.  Of course the LocationListener would be pausing when I pause the map.

Solution: I moved my LocationListener to the Service & am now broadcasting location updates back to the map activity.
0 Kudos