I have a location:
public Location temp;
Now I want remember some coordinates on the map, so I do this:
double a = 40.156729, b = 44.47197;
temp.setLatitude(40.156729);
temp.setLongitude(44.47197);
This throws NullPointerException.
I also tried in this way:
double a = 40.156729, b = 44.47197;
temp.setLatitude(a);
temp.setLongitude(b);
But still the same.
Logcat:
06-05 09:32:55.720: E/AndroidRuntime(1370): Caused by: java.lang.NullPointerException
Thanks.
Have yout initialized the Location object? For instance: