pawpaw17 wrote:
> In my activities onCreate method I start listening for location
> updates as follows:
>
> locationManager.requestLocationUpdates(bestProvider, 5000, 0,
> myLocationListener);
>
> Previously I used 60,000 ms instead of 5,000 ms.
>
> The problem is that I have trouble getting the first update.
>
> public void onLocationChanged(Location location){
> if (location != null){
> lastlocation = location;
> }
> }
>
> onLocationChanged doesn't get called.
>
> Now, if I switch to Maps and find the current location there, then
> switch back to
> my app, I finally get the onLocatinoChanged method to fire.
>
> This whole location changed stuff seems rinky in Android. Is there a
> way to
> more directly insist that the Location hardware do it's thing?
You assume the existence of location hardware. Not all devices will have
location hardware (a.k.a., GPS).
> Any help would be very much appreciated.
1. What location provider are you attempting to use?
2. Does LogCat tell you anything? You can examine this via adb logcat,
DDMS, or the DDMS perspective in Eclipse.
3. Have you tried any location code that is known to work (e.g., from a
blog post)?
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android App Developer Training: http://commonsware.com/training.html
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---