I have been looking at and playing with the FusedLocationProviderApi
. That class contains these two methods:
PendingResult<Status> requestLocationUpdates(GoogleApiClient client, LocationRequest request, LocationCallback callback, Looper looper)
PendingResult<Status> requestLocationUpdates(GoogleApiClient client, LocationRequest request, LocationListener listener, Looper looper)
They have very similar signatures and descriptions with the only difference being that one uses LocationCallback
and the other uses LocationListener
.
The abstract class LocationCallback
defines two methods:
void onLocationAvailability(LocationAvailability locationAvailability)
void onLocationResult(LocationResult result)
and the interface LocationListener
defines just one method
abstract void onLocationChanged(Location location)
Disregarding the additional method in LocationCallback
, what is the difference between these two? Is there some conceptual difference or special use case that makes one preferable over the other? What is the rationale in duplicating the functionality?