Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public static interface

LoaderManager.LoaderCallbacks

android.app.LoaderManager.LoaderCallbacks<D>

Class Overview

Callback interface for a client to interact with the manager.

Summary

Public Methods
abstract Loader <D> onCreateLoader (int id, Bundle args)
Instantiate and return a new Loader for the given ID.
abstract void , D)">onLoadFinished ( Loader <D> loader, D data)
Called when a previously created loader has finished its load.
abstract void )">onLoaderReset ( Loader <D> loader)
Called when a previously created loader is being reset, and thus making its data unavailable.

Public Methods

public abstract Loader <D> onCreateLoader (int id, Bundle args)

Instantiate and return a new Loader for the given ID.

Parameters
id The ID whose loader is to be created.
args Any arguments supplied by the caller.
Returns
  • Return a new Loader instance that is ready to start loading.
, D)">

public abstract void onLoadFinished ( Loader <D> loader, D data)

Called when a previously created loader has finished its load. Note that normally an application is not allowed to commit fragment transactions while in this call, since it can happen after an activity's state is saved. See FragmentManager.openTransaction() for further discussion on this.

This function is guaranteed to be called prior to the release of the last data that was supplied for this Loader. At this point you should remove all use of the old data (since it will be released soon), but should not do your own release of the data since its Loader owns it and will take care of that. The Loader will take care of management of its data so you don't have to. In particular:

Parameters
loader The Loader that has finished.
data The data generated by the Loader.
)">

public abstract void onLoaderReset ( Loader <D> loader)

Called when a previously created loader is being reset, and thus making its data unavailable. The application should at this point remove any references it has to the Loader's data.

Parameters
loader The Loader that is being reset.