Hi,

I have a message handler(see code bellow) that will stop or start
location updates(it also manages messages for other things), and this
handler is called each time i close or open a SlidingDrawer, the
sliding drawer works ok and it sends only once each of the messages as
corresponds. The problem is that startLocationUpdates is always called
inmediatly after stopLocationUpdates or at any time, but i am not
triggering any message for that, it is just happening. The messages
are just send many times, I think it might be related with some
recicling of the messages, but i have tried creating new messages and
obtaining recicled messages from the pool. both cases it fails and
just send messages, on its own.


My code is at follows:

@Override
        public void handleMessage(Message msg) {
            case STOP_LOCATION_UPDATES:
                stopLocationUpdates();

            case START_LOCATION_UPDATES:
                startLocationUpdates();

             ......more cases.......

}

        public void stopLocationUpdates() {
        
this.MainActivity.getLocationManager().removeUpdates(this.safeRideMainActivity.getLocationListener());

        }

        public void startLocationUpdates() {
        
this.MainActivity.getLocationManager().requestLocationUpdates(LocationManager.GPS_PROVIDER,
5000, 2, this.MainActivity.getLocationListener());

        }



Thanks for any help, and just let me know if more code is needed.

-- 
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