Hey mates, is it possible, that android cleares the last known location after a restart? Yesterday my code worked very fine, but today after rebooting my phone (AND emulator) it seems that the .getLastKnownLocation (see below) returns null, which leads to a nullPointerException... Can you confirm that? How can I avoid this problem? I'm desperately searching for an answer
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
...
Location locUser = lm
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
posUser = new GeoPoint((int) (locUser.getLatitude() * 1E6),
(int) (locUser.getLongitude() * 1E6));
Would be great if someone coult give me a hint or point out my mistake.
Nice greetings, Poeschlorn