I want to get current location using GPS.
Here is my scenario. My class definition is:
public class UseGps extends Activity implements LocationListener
If Í try to override the LocationListener methods like this
1)
@Override
public void onLocationChanged(Location loc)
2)
@Override
public void onProviderDisabled(String provider)
3)
@Override
public void onProviderEnabled(String provider)
it is giving me compilation error saying
The method onStatusChanged(String, int, Bundle) of type UseGps must override a superclass method remove override.
Same for 2) and 3)
What is wrong here?
Assuming that you are using Eclipse do the following to ensure that your compliance level is 1.6.
Go to
Project->Properties->Java Compiler. There make sure thatCompiler compliance levelis set to1.6.You should set that level as a default value by navigating to
Window->Preferences->Java->Compiler. Select1.6forCompiler compliance level.