java.lang.Object | |
↳ | android.support.v4.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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
LoaderManager.LoaderCallbacks <D> | Callback interface for a client to interact with the manager. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Stops and removes the loader with the given ID.
|
||||||||||
|
Print the LoaderManager's state into the given stream.
|
||||||||||
|
Control whether the framework's internal loader manager debugging
logs are turned on.
|
||||||||||
|
Return the Loader with the given id or null if no matching Loader
is found.
|
||||||||||
|
Returns true if any loaders managed are currently running and have not
returned data to the application yet.
|
||||||||||
|
Ensures a loader is initialized and active.
|
||||||||||
|
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.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Stops and removes the loader with the given ID. If this loader
had previously reported data to the client through
, a call
will be made to
.
Print the LoaderManager's state into the given stream.
prefix | Text to print at the front of each line. |
---|---|
fd | The raw file descriptor that the dump is being sent to. |
writer | A PrintWriter to which the dump is to be set. |
args | Additional arguments to the dump request. |
Control whether the framework's internal loader manager debugging logs are turned on. If enabled, you will see output in logcat as the framework performs loader operations.
Return the Loader with the given id or null if no matching Loader is found.
Returns true if any loaders managed are currently running and have not returned data to the application yet.
Ensures a loader is initialized and active. If the loader doesn't already exist, one is created and (if the activity/fragment is currently started) starts the loader. Otherwise the last created loader is re-used.
In either case, the given callback is associated with the loader, and
will be called as the loader state changes. If at the point of call
the caller is in its started state, and the requested loader
already exists and has generated its data, then
callback
will
be called immediately (inside of this function), so you must be prepared
for this to happen.
id | A unique identifier for this loader. Can be whatever you want. Identifiers are scoped to a particular LoaderManager instance. |
---|---|
args | Optional arguments to supply to the loader at construction. If a loader already exists (a new one does not need to be created), this parameter will be ignored and the last arguments continue to be used. |
callback | Interface the LoaderManager will call to report about changes in the state of the loader. Required. |
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.
If a loader with the same id has previously been
started it will automatically be destroyed when the new loader completes
its work. The callback will be delivered before the old loader
is destroyed.
id | A unique identifier for this loader. Can be whatever you want. Identifiers are scoped to a particular LoaderManager instance. |
---|---|
args | Optional arguments to supply to the loader at construction. |
callback | Interface the LoaderManager will call to report about changes in the state of the loader. Required. |