Casey Borders wrote: > I'm trying to use the getBestProvider to get a LocationProvider, but no > matter if I allow cost or not it returns null. Here's the code I'm using. > > Criteria criteria = new Criteria(); > criteria.setCostAllowed(mUseAGPS); > mGPS = mLocationManager.getBestProvider(criteria); > > Am I doing something wrong here?
I remember having some hiccups with getBestProvider() but I forget the specifics. Have you granted your application the ACCESS_LOCATION permission? You may also need the similar GPS permission as well. It's possible getBestProvider() filters out those you don't have permission to use. -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the Ranch in September! http://www.bignerdranch.com --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

