public final class FusedPrintersProvider extends Loader<List<PrinterInfo>> implements LocationListener
Loader.ForceLoadContentObserver, Loader.OnLoadCanceledListener<D>, Loader.OnLoadCompleteListener<D>
Constructor and Description |
---|
FusedPrintersProvider(Activity activity,
int internalLoaderId) |
Modifier and Type | Method and Description |
---|---|
void |
addHistoricalPrinter(PrinterInfo printer) |
boolean |
areHistoricalPrintersLoaded() |
void |
forgetFavoritePrinter(PrinterId printerId) |
boolean |
isFavoritePrinter(PrinterId printerId) |
protected void |
onAbandon()
Subclasses implement this to take care of being abandoned.
|
protected boolean |
onCancelLoad()
Subclasses must implement this to take care of requests to
Loader.cancelLoad() . |
protected void |
onForceLoad()
Subclasses must implement this to take care of requests to
Loader.forceLoad() . |
void |
onLocationChanged(Location location)
Called when the location has changed.
|
void |
onProviderDisabled(String provider)
Called when the provider is disabled by the user.
|
void |
onProviderEnabled(String provider)
Called when the provider is enabled by the user.
|
protected void |
onReset()
Subclasses must implement this to take care of resetting their loader,
as per
Loader.reset() . |
protected void |
onStartLoading()
Subclasses must implement this to take care of loading their data,
as per
Loader.startLoading() . |
void |
onStatusChanged(String provider,
int status,
Bundle extras)
Called when the provider status changes.
|
protected void |
onStopLoading()
Subclasses must implement this to take care of stopping their loader,
as per
Loader.stopLoading() . |
void |
setTrackedPrinter(PrinterId printerId) |
abandon, cancelLoad, commitContentChanged, dataToString, deliverCancellation, deliverResult, dump, forceLoad, getContext, getId, isAbandoned, isReset, isStarted, onContentChanged, registerListener, registerOnLoadCanceledListener, reset, rollbackContentChanged, startLoading, stopLoading, takeContentChanged, toString, unregisterListener, unregisterOnLoadCanceledListener
public FusedPrintersProvider(Activity activity, int internalLoaderId)
public void addHistoricalPrinter(PrinterInfo printer)
protected void onStartLoading()
Loader
Loader.startLoading()
. This is not called by clients directly,
but as a result of a call to Loader.startLoading()
.onStartLoading
in class Loader<List<PrinterInfo>>
protected void onStopLoading()
Loader
Loader.stopLoading()
. This is not called by clients directly,
but as a result of a call to Loader.stopLoading()
.
This will always be called from the process's main thread.onStopLoading
in class Loader<List<PrinterInfo>>
protected void onForceLoad()
Loader
Loader.forceLoad()
.
This will always be called from the process's main thread.onForceLoad
in class Loader<List<PrinterInfo>>
protected boolean onCancelLoad()
Loader
Loader.cancelLoad()
.
This will always be called from the process's main thread.onCancelLoad
in class Loader<List<PrinterInfo>>
Loader.startLoading()
hasn't been called; returns
true otherwise. When true is returned, the task
is still running and the Loader.OnLoadCanceledListener
will be called
when the task completes.protected void onReset()
Loader
Loader.reset()
. This is not called by clients directly,
but as a result of a call to Loader.reset()
.
This will always be called from the process's main thread.onReset
in class Loader<List<PrinterInfo>>
protected void onAbandon()
Loader
Loader.onReset()
-- it means that
the client is no longer interested in any new data from the loader,
so the loader must not report any further updates. However, the
loader must keep its last reported data valid until the final
Loader.onReset()
happens. You can retrieve the current abandoned
state with Loader.isAbandoned()
.onAbandon
in class Loader<List<PrinterInfo>>
public void onLocationChanged(Location location)
LocationListener
There are no restrictions on the use of the supplied Location object.
onLocationChanged
in interface LocationListener
location
- The new location, as a Location object.public void onStatusChanged(String provider, int status, Bundle extras)
LocationListener
onStatusChanged
in interface LocationListener
provider
- the name of the location provider associated with this
update.status
- LocationProvider.OUT_OF_SERVICE
if the
provider is out of service, and this is not expected to change in the
near future; LocationProvider.TEMPORARILY_UNAVAILABLE
if
the provider is temporarily unavailable but is expected to be available
shortly; and LocationProvider.AVAILABLE
if the
provider is currently available.extras
- an optional Bundle which will contain provider specific
status variables.
A number of common key/value pairs for the extras Bundle are listed below. Providers that use any of the keys on this list must provide the corresponding value as described below.
public void onProviderEnabled(String provider)
LocationListener
onProviderEnabled
in interface LocationListener
provider
- the name of the location provider associated with this
update.public void onProviderDisabled(String provider)
LocationListener
onProviderDisabled
in interface LocationListener
provider
- the name of the location provider associated with this
update.public boolean areHistoricalPrintersLoaded()
public void setTrackedPrinter(PrinterId printerId)
public boolean isFavoritePrinter(PrinterId printerId)
public void forgetFavoritePrinter(PrinterId printerId)