added in version 22.1.0
belongs to Maven artifact com.android.support:loader:28.0.0-alpha1

Loader

public class Loader
extends Object

java.lang.Object
   ↳ android.support.v4.content.Loader<D>
Known Direct Subclasses
Known Indirect Subclasses


Static library support version of the framework's Loader. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Summary

Nested classes

class Loader.ForceLoadContentObserver

An implementation of a ContentObserver that takes care of connecting it to the Loader to have the loader re-load its data when the observer is told it has changed. 

interface Loader.OnLoadCanceledListener<D>

Interface that is implemented to discover when a Loader has been canceled before it finished loading its data. 

interface Loader.OnLoadCompleteListener<D>

Interface that is implemented to discover when a Loader has finished loading its data. 

Public constructors

Loader(Context context)

Stores away the application context associated with context.

Public methods

void abandon()

This function will normally be called for you automatically by LoaderManager when restarting a Loader.

boolean cancelLoad()

Attempt to cancel the current load task.

void commitContentChanged()

Commit that you have actually fully processed a content change that was returned by takeContentChanged().

String dataToString(D data)

For debugging, converts an instance of the Loader's data class to a string that can be printed.

void deliverCancellation()

Informs the registered Loader.OnLoadCanceledListener that the load has been canceled.

void deliverResult(D data)

Sends the result of the load to the registered listener.

void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

Print the Loader's state into the given stream.

void forceLoad()

Force an asynchronous load.

Context getContext()
int getId()
boolean isAbandoned()

Return whether this loader has been abandoned.

boolean isReset