Hi

I am having some problems with the LocationListener class...
I use it to get my location, and it works fine, but the problem is
that is called too often, freezing the application...

the following code is (in theory, if I understood it right) to request
the location update every 5 minutes, or when I move 10 km, but it is
being called too often
What am I doing wrong?
is there any way to stop the location update to be called after I
receive the first one?



        static LocationManager lm;
        static LocationListener locationListener;


        lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        locationListener = new MyLocationListener();
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,
        500000,//5 )minutes
        10000,//10 km
        locationListener);





Thanks



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