I am developing an application that uses the GPS functionality. I am getting
a null pointer exception at the code below:

Location l = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);

The java docs for the getLastKnownLocation states that: " if the provider is
disabled, null is returned.

I am getting null for the value of "l".

I have also send the GPS coordinates using the DDMS tool and have assigned
the permissions for using GPS "ACCESS_FINE_LOCATION".

What does it means by "disabled provider" and how to handle this error.


Thank you in advance.

-- sohail

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