Error Getting Location Android (gps And Network)
I want to get the location in my APP using the following code: public Location getLocation() { boolean isGPSEnabled = false; boolean isNetworkEnabled = false;
Solution 1:
If the device have not yet found a location, it will return null.
I bet if your open Google Maps and let it locate you before opening your app, it will work as expected.
See my answer to Location servise GPS Force closed. This is an example on how you can implement a callback to let you know as soon as a location is available.
Solution 2:
I think you have to trigger it by calling one of the .request... functions.
Post a Comment for "Error Getting Location Android (gps And Network)"