timv
timv

Reputation: 3366

android.location.locationlistener is already defined in a single-type import

Edit: slightly different as I was getting a request location update error that resulted in the extra import issue.

I am getting a strange error that my locationlistener is already defined in a single type import.is already defined in a single type import

Not sure what I have done incorrectly?

I was fixing another error where requestLocationUpdates is not recognised. can not resolve method requestlocationupdates Here is my class implement line:

public class MapPage extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, android.location.LocationListener {

Upvotes: 2

Views: 1617

Answers (1)

Linh
Linh

Reputation: 60989

This error happened because in your class your import both

import com.google.android.gms.location.LocationListener;
import android.location.LocationListener;

Consider to use only one or you can use LocationListenr without import like

private com.google.android.gms.location.LocationListener googleLocationListener;
private android.location.LocationListener androidLocationListener;

Upvotes: 4

Related Questions