Using the google location.getlatitiude and location.getlongitude by
location = locationManager.getLastKnownLocation(locationProvider);
Latitude = location.getLatitude();
Longitude = location.getLongitude();
This is done inside a recurring runnable that fires every 5 seconds. So far so good.
When I "pause" the app (click the back button so app is running in the background) the above calls do not get new locations (they keep returning the last longitude and latitude before the pause).
I know the runnable is still firing as I also write to a web database during the runnable and the database is being hit and updated (just with stalled latitude and longitude values).
Once the app is unpaused/resumed and becomes visible the longitude and latitude readings resume and update correctly.
location, locationManager and locationProvider are globals outside the Runnable and created and verified prior to setting the runnable running, so it isn;t an issue with creating them when the app is paused.
Any ideas as to why pausing causes this? I have tested on 2 different phones. Both the same result. Is there some way I can tell the location or locationmanager to keep working even when app is paused?