title: com.google.android.gms.location.LocationListener cannot be converted to android.location.LocationListener
body: <p>I get the following error</p>
  
  <pre><code>Error:(197, 28) error: no suitable method found for requestLocationUpdates    (String,long,float,com.google.android.gms.location.LocationListener) method LocationManager.requestLocationUpdates (String,long,float,android.location.LocationListener) is not applicable
  (argument mismatch; com.google.android.gms.location.LocationListener cannot be converted to android.location.LocationListener)
  method LocationManager.requestLocationUpdates(String,long,float,PendingIntent) is not applicable
  (argument mismatch; com.google.android.gms.location.LocationListener cannot be converted to PendingIntent)
  
  method LocationManager.requestLocationUpdates(long,float,Criteria,PendingIntent) is not applicable
  (argument mismatch; String cannot be converted to long)
  </code></pre>
  
  <p>when trying to run my Code although this line is underlined with red in Android Studio</p>
  
  <blockquote>
    <p>LocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,LOCATION_REFRESH_TIME,
    LOCATION_REFRESH_DISTANCE, LocationListener);</p>
  </blockquote>
  
  <p><strong>I still did't find out where the mismatch comes from and would be thankful for any hints or help</strong></p>
  
  <p>This is my Location Listener:</p>
  
  <pre><code>private final LocationListener LocationListener = new LocationListener() {
          @Override
          public void onLocationChanged(final Location location) {
              updateLocation(location);
          }
  </code></pre>
  
  <p>it calls the following updateLocation:</p>
  
  <pre><code> protected void updateLocation(Location location) {
  
        if (location != null &amp;&amp; gpsFix == true) {
            addPoint(location);
  
            if (previousLocation != null)
                distanceTraveled += location.distanceTo(previousLocation);
        }
        previousLocation = location;
    }
  </code></pre>
  
  <p>which calls addPoint</p>
  
  <pre><code>  public void addPoint(Location location) {
        locations.add(location);
    }
  </code></pre>
  
  <p>Locations is an ArrayList of Location-objects. Apart from that I have these declarations:</p>
  
  <pre><code> float LOCATION_REFRESH_DISTANCE = 1;
   long LOCATION_REFRESH_TIME = 100;
  </code></pre>
  
  <p>EDIT: When I try this  </p>
  
  <blockquote>
    <p>LocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,LOCATION_REFRESH_TIME,
    LOCATION_REFRESH_DISTANCE,
    (android.location.LocationListener)LocationListener);</p>
  </blockquote>
  
  <p>I see the following: Non-static method 'requestLocationUpdates (...)' cannot be referenced from a static context.</p>
  
  <p>And These are my Imports:</p>
  
  <pre><code>import android.content.Context;
  import android.content.pm.PackageManager;
  import android.graphics.Color;
  import android.graphics.Paint;
  import android.location.Criteria;
  import android.location.Location;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.os.PowerManager;
  import android.support.v4.app.ActivityCompat;
  import android.support.v4.app.FragmentActivity;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.FrameLayout;
  import android.location.LocationListener;
  import com.google.android.gms.appindexing.AppIndex;
  import com.google.android.gms.common.api.GoogleApiClient;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapView;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  import com.google.android.gms.maps.model.PolylineOptions;
  import java.util.ArrayList;
  import java.util.List;
  </code></pre>