I want to get Location Updates using this method : FusedLocationProviderClient#requestLocationUpdates(LocationRequest locationRequest, LocationCallback locationCallback, Looper looper)
And most of the answers in Stackoverflow implementing this method had to override LocationCallback methods. One recent example can be found in this question
Code snippet from that question is below :
mLocationCallback = new LocationCallback() {
@Override
public void onLocationResult(LocationResult locationResult) {
synchronized (SilentCurrentLocationProvider.this) {
super.onLocationResult(locationResult);
Location location = locationResult.getLastLocation();
}
};
But when I try to initialize LocationCallback like this. I am not forced to override method like the above by Android Studio. And when I inspect the source code of LocationCallback class then I find it as normal java class and onLocationResult method is there but that is not to override.