Android cannot resolve method requestLocationUpdates FusedLocationProviderAPI Android cannot resolve method requestLocationUpdates FusedLocationProviderAPI android android

Android cannot resolve method requestLocationUpdates FusedLocationProviderAPI


You have to use LocationListener for LocationServices.FusedLocationApi.requestLocationUpdates's locationListener

not

android.location.LocationListener

but

com.google.android.gms.location.LocationListener


Import

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

instead of

import android.location.LocationListener;


Replace

import android.location.LocationListener;

From

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

andremove these override methods

public void onStatusChanged(String provider, int status, Bundle extras) {}@Overridepublic void onProviderEnabled(String provider) {}@Overridepublic void onProviderDisabled(String provider) {}