Hi I'm having a problem when trying to stop location updates when the
app goes into the background. In my onCreate() method I start request
updates like this:

                LocationManager locationManager =
(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);

                
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
LOCATION_UPDATE_INTERVAL, LOCATION_UPDATE_DISTANCE, this);
        
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
LOCATION_UPDATE_INTERVAL, LOCATION_UPDATE_DISTANCE, this);

Then in my onPause() and onDestroy() methods I request to stop the
updates like this:

                LocationManager locationManager =
(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
                locationManager.removeUpdates(this);

However the GPS icon remains in the status bar and the only way to get
rid of it is to manually kill the application. Am I doing anything
wrong?

Cheers

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to