Your issue is most likely elsewhere in the code logic. Disabling/
enabling the listener works fine for me across all possible device/API
version combinations.

On Mar 10, 9:48 pm, Shao <[email protected]> wrote:
> Hi all,
>
> I was playing around with the GPS location on my Android.  What I'm
> trying to do was make a toggle button that can turn it on and off.
>
> When I turn it on, I'll set my LocationListener to the request
> location updates call.
>
> When I turn it off, I'll remove location updates and pass in my
> LocationListener.
>
> The problem I'm seeing though is that this works fine the first time,
> but after turning it off and then turning it on again the GPS does
> start up and update locations but the onLocationChanged is no longer
> called.
>
> I was also trying to create a routine to save battery life by changing
> the time "hint" between updates if the location is relatively static
> for a while.  But again, onLocationChanged no longer gets called if I
> remove location updates and then request location updates again with
> the same location listener (it's a static LocationListener).
>
> Wondering if anyone else came across this?

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

Reply via email to