I have a problem related to the Location API.
I tried the following code:
LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SER
You need the instance Of LocationManager like this:
First Instance:
LocationManager lm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
Wrong:
Location loc = getLastKnownLocation(LocationManager.GPS_PROVIDER);
Correct:
Location loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);