[Solved] Android Null object reference on location [duplicate]


You are calling public double getLatitude() from your GPS class, however the _location variable is not initialized hence you get the NullPointerException.

Prior calling getLatitude() try calling the public Location getLastKnownLocation() from your GPS class. This call will initialize the _location variable.

0

solved Android Null object reference on location [duplicate]