when i set time intervel in LocationRequest then location getting perfectly using this code
private static final long INTERVAL = 500 * 1;
private static final long FASTEST_INTERVAL = 500 * 1;
private static final int SMALLEST_DISPLACEMENT = 5;
protected void createLocationRequest() {
LocationRequest mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(INTERVAL);
mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
mLocationRequest.setSmallestDisplacement(SMALLEST_DISPLACEMENT);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
}
but when i remove these line then onLocationChanged not working. is it neccessary to set time intervel in LocationRequest?
mLocationRequest.setInterval(INTERVAL);
mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
i want to get location according to displacement not according to time intervel.