Im having problems with my current code, i don't see what i'm doing wrong. i keep getting the error "no suitable method found for requestLocationUpdates(string,int,in,MapsActivity)
public class MapsActivity extends AppCompatActivity implements LocationListener, OnMapReadyCallback, View.OnClickListener, DirectionCallback, OnMapClickListener, GoogleApiClient.OnConnectionFailedListener {
private LocationManager locationManager;
private Button btnRequestDirection;
GPSTracker gps;
private GoogleMap googleMap;
private String serverKey = "xxx";
private LatLng camera = new LatLng(54.1111, -1.1111);
private LatLng origin = new LatLng(54.1111, -1.1111);
private LatLng destination = new LatLng(54.11, -1.11);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
gps = new GPSTracker(MapsActivity.this);
long i = 1000;
long x = 10;
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,i,x, this);
if (gps.canGetLocation()) {
camera = new LatLng(gps.getLatitude(), gps.getLongitude());
origin = camera;
btnRequestDirection = (Button) findViewById(R.id.btn_request_direction);
btnRequestDirection.setOnClickListener(this);
((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMapAsync(this);
} else {
gps.showSettingsAlert();
}
}
Everything i do the event "onLocationChanged()" never triggers, =/