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

[ad_1]

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

[ad_2]

solved Android Null object reference on location [duplicate]