Lines Matching defs:task

46  * <p>An asynchronous task is defined by a computation that runs on a background thread and
47 * whose result is published on the UI thread. An asynchronous task is defined by 3 generic
89 * <p>Once created, a task is executed very simply:</p>
95 * <p>The three types used by an asynchronous task are the following:</p>
97 * <li><code>Params</code>, the type of the parameters sent to the task upon
104 * <p>Not all types are always used by an asynchronous task. To mark a type as unused,
111 * <p>When an asynchronous task is executed, the task goes through 4 steps:</p>
113 * <li>{@link #onPreExecute()}, invoked on the UI thread before the task
114 * is executed. This step is normally used to setup the task, for instance by
119 * of the asynchronous task are passed to this step. The result of the computation must
134 * <h2>Cancelling a task</h2>
135 * <p>A task can be cancelled at any time by invoking {@link #cancel(boolean)}. Invoking
139 * returns. To ensure that a task is cancelled as quickly as possible, you should always
149 * <li>The task instance must be created on the UI thread.</li>
153 * <li>The task can be executed only once (an exception will be thrown if
250 * Indicates the current status of the task. Each status will be set only once
251 * during the lifetime of a task.
255 * Indicates that the task has not been executed yet.
259 * Indicates that the task is running.
279 * Creates a new asynchronous task. This constructor must be invoked on the UI thread.
325 * Returns the current status of this task.
336 * by the caller of this task.
341 * @param params The parameters of the task.
343 * @return A result, defined by the subclass of this task.
364 * <p>This method won't be invoked if the task was cancelled.</p>
424 * Returns <tt>true</tt> if this task was cancelled before it completed
425 * normally. If you are calling {@link #cancel(boolean)} on the task,
427 * {@link #doInBackground(Object[])} to end the task as soon as possible.
429 * @return <tt>true</tt> if task was cancelled before it completed
438 * <p>Attempts to cancel execution of this task. This attempt will
439 * fail if the task has already completed, already been cancelled,
441 * and this task has not started when <tt>cancel</tt> is called,
442 * this task should never run. If the task has already started,
444 * whether the thread executing this task should be interrupted in
445 * an attempt to stop the task.</p>
452 * {@link #doInBackground(Object[])} to finish the task as early as
456 * task should be interrupted; otherwise, in-progress tasks are allowed
459 * @return <tt>false</tt> if the task could not be cancelled,
507 * Executes the task with the specified parameters. The task returns
510 * <p>Note: this function schedules the task on a queue for a single background
524 * @param params The parameters of the task.
539 * Executes the task with the specified parameters. The task returns
562 * @param params The parameters of the task.
576 throw new IllegalStateException("Cannot execute task:"
577 + " the task is already running.");
579 throw new IllegalStateException("Cannot execute task:"
580 + " the task has already been executed "
581 + "(a task can be executed only once)");
613 * {@link #onProgressUpdate} will note be called if the task has been
663 AsyncTaskResult(AsyncTask task, Data... data) {
664 mTask = task;