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 that Compiler compliance level
is set to 1.6
.
You should set that level as a default value by navigating to Window
-> Preferences
-> Java
-> Compiler
. Select 1.6
for Compiler compliance level
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With