I am working on creating my first android code, and I am having some problems.
I was using a dexv article for help on the code: http://www.devx.com/wireless/Article/43005/1954
I am getting the following errors when I write the code in eclipse:
The type new LocationListener(){} must implement the inherited abstract methodLocationListener.onLocationChanged (Location)
and
- Location cannot be resolved to a type
Here is the code:
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.location.LocationListener;
import android.location.LocationManager;
public class flightnav extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
LocationManager locMan;
locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 100, 1, gpsListener);
}
LocationListener gpsListener = new LocationListener(){
Location curLocation;
boolean locationChanged = false;
public void onLocationChanged(Location location)
{
if(curLocation == null)
{
curLocation = location;
locationChanged = true;
}
if(curLocation.getLatitude() == location.getLatitude() &&
curLocation.getLongitude() == location.getLongitude())
locationChanged = false;
else
locationChanged = true;
curLocation = location;
}
public void onProviderDisabled(String provider){}
public void onProviderEnabled(String provider){}
public void onStatusChanged(String provider, int status, Bundle extras){}
};
}
Any help would be greatly appreciated.


