IT. Expert System.

Android Reference



Class AsyncTaskLoader<D>

  • Type Parameters:
    D - the data type to be loaded.
    Direct Known Subclasses:

    public abstract class AsyncTaskLoader<D>
    extends Loader<D>
    Abstract Loader that provides an AsyncTask to do the work. See Loader and LoaderManager for more details.

    Here is an example implementation of an AsyncTaskLoader subclass that loads the currently installed applications from the package manager. This implementation takes care of retrieving the application labels and sorting its result set from them, monitoring for changes to the installed applications, and rebuilding the list when a change in configuration requires this (such as a locale change).

    An example implementation of a fragment that uses the above loader to show the currently installed applications in a list is below.

    • Constructor Detail

      • AsyncTaskLoader

        public AsyncTaskLoader(Context context)
    • Method Detail

      • setUpdateThrottle

        public void setUpdateThrottle(long delayMS)
        Set amount to throttle updates by. This is the minimum time from when the last loadInBackground() call has completed until a new load is scheduled.
        delayMS - Amount of delay, in milliseconds.
      • onForceLoad

        protected void onForceLoad()
        Description copied from class: Loader
        Subclasses must implement this to take care of requests to Loader.forceLoad(). This will always be called from the process's main thread.
        onForceLoad in class Loader<D>
      • onCancelLoad

        protected boolean onCancelLoad()
        Description copied from class: Loader
        Subclasses must implement this to take care of requests to Loader.cancelLoad(). This will always be called from the process's main thread.
        onCancelLoad in class Loader<D>
        Returns false if the task could not be canceled, typically because it has already completed normally, or because 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.
      • onCanceled

        public void onCanceled(D data)
        Called if the task was canceled before it was completed. Gives the class a chance to clean up post-cancellation and to properly dispose of the result.
        data - The value that was returned by loadInBackground(), or null if the task threw OperationCanceledException.
      • cancelLoadInBackground

        public void cancelLoadInBackground()
        Called on the main thread to abort a load in progress. Override this method to abort the current invocation of loadInBackground() that is running in the background on a worker thread. This method should do nothing if loadInBackground() has not started running or if it has already finished.
        See Also:
      • waitForLoader

        public void waitForLoader()
        Locks the current thread until the loader completes the current load operation. Returns immediately if there is no load operation running. Should not be called from the UI thread: calling it from the UI thread would cause a deadlock.

        Use for testing only. Never call this from a UI thread.

      • dump

        public void dump(String prefix,
                FileDescriptor fd,
                PrintWriter writer,
                String[] args)
        Description copied from class: Loader
        Print the Loader's state into the given stream.
        dump in class Loader<D>
        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.


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 568 / 159267459. Delta: 0.03474 с