Did you search just even a little bit on google? http://stackoverflow.com/questions/15409754/getlastknownlocation-returns-null-even-with-best-provider http://stackoverflow.com/questions/19621882/getlastknownlocation-returning-null
You should check that _location isn't null and if it is, do something, catch something so that it doesn't simply crash. It's possible that there isn't any location returned if the provider wasn't use recently. So in that case getLastKnownLocation will return null and you'll have to wait for a real fix (ie onLocationChanged()). -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.