LoaderManager

public abstract class LoaderManager
extends Object

java.lang.Object
   ↳ androidx.loader.app.LoaderManager


Static library support version of the framework's LoaderManager. 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.

Your activity must derive from FragmentActivity to use this.

Summary

Nested classes

interface LoaderManager.LoaderCallbacks<D>

Callback interface for a client to interact with the manager. 

Public constructors

LoaderManager()

Public methods

abstract void destroyLoader(int id)

Stops and removes the loader with the given ID.

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

This method is deprecated. Use enableDebugLogging(boolean) to understand the series of operations performed by LoaderManager.

static void enableDebugLogging(boolean enabled)

Control whether the framework's internal loader manager debugging logs are turned on.

static <T extends LifecycleOwner & ViewModelStoreOwner> LoaderManager getInstance(T owner)

Gets a LoaderManager associated with the given owner, such as a FragmentActivity or Fragment.

abstract <D> Loader<D> getLoader(int id)

Return the Loader with the given id or null if no matching Loader is found.

boolean hasRunningLoaders()

Returns true if any loaders managed are currently running and have not returned data to the application yet.

abstract <D> Loader<D> initLoader(int id, Bundle args, LoaderCallbacks<D> callback)

Ensures a loader is initialized and active.

abstract void markForRedelivery()

Mark all Loaders associated with this LoaderManager for redelivery of their current data (if any), waiting for the next time the Loader is started if it is currently stopped.

abstract <D> Loader<D> restartLoader(int id, Bundle args, LoaderCallbacks<D> callback)

Starts a new or restarts an existing Loader in this manager, registers the callbacks to it, and (if the activity/fragment is currently started) starts loading it.