/external/robolectric/src/main/java/android/os/ |
ShadowAsyncTaskBridge.java | 7 private AsyncTask<Params, Progress, Result> asyncTask; 9 public ShadowAsyncTaskBridge(AsyncTask<Params, Progress, Result> asyncTask) { 10 this.asyncTask = asyncTask; 14 return asyncTask.doInBackground(params); 18 asyncTask.onPreExecute(); 22 asyncTask.onPostExecute(result); 26 asyncTask.onProgressUpdate(values) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/shadows/ |
AsyncTaskTest.java | 9 import android.os.AsyncTask; 32 AsyncTask<String, String, String> asyncTask = new MyAsyncTask(); 34 asyncTask.execute("a", "b"); 39 assertEquals("Result should get stored in the AsyncTask", "c", asyncTask.get(100, TimeUnit.MILLISECONDS)); 47 AsyncTask<String, String, String> asyncTask = new MyAsyncTask(); 49 asyncTask.execute("a", "b"); 52 assertTrue(asyncTask.cancel(true)) [all...] |
/external/robolectric/src/main/java/com/xtremelabs/robolectric/shadows/ |
ShadowAsyncTask.java | 3 import android.os.AsyncTask; 17 @Implements(AsyncTask.class) 20 @RealObject private AsyncTask<Params, Progress, Result> realAsyncTask; 24 private AsyncTask.Status status = AsyncTask.Status.PENDING; 31 status = AsyncTask.Status.FINISHED; 76 public AsyncTask<Params, Progress, Result> execute(final Params... params) { 77 status = AsyncTask.Status.RUNNING; 92 public AsyncTask.Status getStatus() { 97 * Enqueue a call to {@link AsyncTask#onProgressUpdate(Object[])} on UI looper (or run it immediatel [all...] |
/packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/ |
EmailAsyncTask.java | 19 import android.os.AsyncTask; 27 * {@link AsyncTask} substitution for the email app. 29 * Modeled after {@link AsyncTask}; the basic usage is the same, with extra features: 32 * - Instead of {@link AsyncTask#onPostExecute}, it has {@link #onSuccess(Object)}, as the 33 * regular {@link AsyncTask#onPostExecute} is a bit hard to predict when it'll be called and 36 * Note this class is missing some of the {@link AsyncTask} features, e.g. it lacks 37 * {@link AsyncTask#onProgressUpdate}. Add these when necessary. 40 private static final Executor SERIAL_EXECUTOR = AsyncTask.SERIAL_EXECUTOR; 41 private static final Executor PARALLEL_EXECUTOR = AsyncTask.THREAD_POOL_EXECUTOR; 109 extends AsyncTask<Params2, Progress2, Result2> [all...] |
/development/samples/browseable/NetworkConnect/ |
_index.jd | 9 The sample uses {@link android.os.AsyncTask} to perform the fetch on a
|
/packages/apps/Dialer/src/com/android/dialer/util/ |
AsyncTaskExecutor.java | 19 import android.os.AsyncTask; 24 * Interface used to submit {@link AsyncTask} objects to run in the background. 27 * the mechanics of AsyncTask submission from the description of how that AsyncTask will execute. 39 * Executes the given AsyncTask with the default Executor. 47 <T> AsyncTask<T, ?, ?> submit(Object identifier, AsyncTask<T, ?, ?> task, T... params);
|
AsyncTaskExecutors.java | 19 import android.os.AsyncTask; 45 * {@link AsyncTask#SERIAL_EXECUTOR}. 52 return new SimpleAsyncTaskExecutor(AsyncTask.SERIAL_EXECUTOR); 58 * {@link AsyncTask#THREAD_POOL_EXECUTOR}. 65 return new SimpleAsyncTaskExecutor(AsyncTask.THREAD_POOL_EXECUTOR); 94 public <T> AsyncTask<T, ?, ?> submit(Object identifer, AsyncTask<T, ?, ?> task,
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/ |
AsyncTaskUtil.java | 19 import android.os.AsyncTask; 27 * Helper class to execute an AsyncTask in parallel if SDK version is 11 or newer. 35 sExecutor = (Executor) AsyncTask.class.getField("THREAD_POOL_EXECUTOR") 37 sMethodExecuteOnExecutor = AsyncTask.class.getMethod( 49 public static <Param> void executeInParallel(AsyncTask<Param, ?, ?> task, Param... params) {
|
/packages/apps/Dialer/tests/src/com/android/dialer/util/ |
FakeAsyncTaskExecutor.java | 20 import android.os.AsyncTask; 44 * methods, so that different ordering of AsyncTask execution can be simulated. 46 * The onPreExecute method of the submitted AsyncTask will be called synchronously during the 47 * call to {@link #submit(Object, AsyncTask, Object...)}. 72 AsyncTask<?, ?, ?> getAsyncTask(); 78 private final AsyncTask<?, ?, ?> mAsyncTask; 81 AsyncTask<?, ?, ?> asyncTask) { 84 mAsyncTask = asyncTask; 98 public AsyncTask<?, ?, ?> getAsyncTask() [all...] |
/frameworks/base/docs/html/training/improving-layouts/ |
smooth-scrolling.jd | 18 <li><a href="#AsyncTask">Use a Background Thread</a></li> 38 <h2 id="AsyncTask">Use a Background Thread</h2> 41 on drawing the UI. In many cases, using {@link android.os.AsyncTask} provides a simple way to 42 perform your work outside the main thread. {@link android.os.AsyncTask} automatically queues up all 43 the {@link android.os.AsyncTask#execute execute()} requests and performs them serially. This 47 <p>In the sample code below, an {@link android.os.AsyncTask} is used to load 52 // Using an AsyncTask to load the slow images in a background thread 53 new AsyncTask<ViewHolder, Void, Bitmap>() { 77 android.os.AsyncTask} so you can enable it to run across multiple processor cores. Instead of 78 calling {@link android.os.AsyncTask#execute execute()} you can specify {@lin [all...] |
/frameworks/base/docs/html/sdk/api_diff/11/changes/ |
android.os.AsyncTask.html | 10 android.os.AsyncTask 74 Class android.os.<A HREF="../../../../reference/android/os/AsyncTask.html" target="_top"><font size="+2"><code>AsyncTask</code></font></A> 86 <A NAME="android.os.AsyncTask.execute_added(java.lang.Runnable)"></A> 87 <nobr><code>void</code> <A HREF="../../../../reference/android/os/AsyncTask.html#execute(java.lang.Runnable)" target="_top"><code>execute</code></A>(<code>Runnable</code>)</nobr> 93 <A NAME="android.os.AsyncTask.executeOnExecutor_added(java.util.concurrent.Executor, Params...)"></A> 94 <nobr>(<code>AsyncTask<Params, Progress, Result></code>) <A HREF="../../../../reference/android/os/AsyncTask.html#executeOnExecutor(java.util.concurrent.Executor, Params...)" target="_top"><code>executeOnExecutor</code></A>(<code>Executor<nobr></code>)</nobr> 100 <A NAME="android.os.AsyncTask.onCancelled_added(Result)"></A> 101 <nobr><code>void</code> <A HREF="../../../../reference/android/os/AsyncTask.html#onCancelled(Result)" target="_top"><code>onCancelled</code></A>(<code>Result</code>)</nobr [all...] |
/packages/apps/Gallery/src/com/android/camera/ |
ReverseGeocoderTask.java | 21 import android.os.AsyncTask; 27 // Reverse geocoding may take a long time to return so we put it in AsyncTask. 28 public class ReverseGeocoderTask extends AsyncTask<Void, Void, String> {
|
/packages/apps/Launcher3/src/com/android/launcher3/ |
PreloadReceiver.java | 22 import android.os.AsyncTask; 43 new AsyncTask<Void, Void, Void>() { 48 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
|
/packages/apps/ContactsCommon/src/com/android/contacts/common/dialog/ |
ClearFrequentsDialog.java | 26 import android.os.AsyncTask; 51 final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() { 64 task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
/development/apps/Development/src/com/android/development/ |
CacheAbuser.java | 32 import android.os.AsyncTask; 50 AsyncTask<Void, Void, Void> mInternalAbuseTask; 51 AsyncTask<Void, Void, Void> mExternalAbuseTask; 53 static class AbuseTask extends AsyncTask<Void, Void, Void> { 109 mInternalAbuseTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); 120 mInternalAbuseTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); 131 mExternalAbuseTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); 142 mExternalAbuseTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
/development/samples/RandomMusicPlayer/src/com/example/android/musicplayer/ |
PrepareMusicRetrieverTask.java | 19 import android.os.AsyncTask; 26 public class PrepareMusicRetrieverTask extends AsyncTask<Void, Void, Void> {
|
/frameworks/base/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ |
TextureBase.java | 22 import android.os.AsyncTask; 32 class SingleImageLoaderTask extends AsyncTask<TextureBase, Void, Boolean> {
|
/packages/apps/UnifiedEmail/src/com/android/mail/ui/ |
AsyncRefreshTask.java | 22 import android.os.AsyncTask; 24 public class AsyncRefreshTask extends AsyncTask<Void, Void, Void> {
|
/frameworks/base/docs/html/training/displaying-bitmaps/ |
process-bitmap.jd | 14 <li><a href="#async-task">Use an AsyncTask</a></li> 48 {@link android.os.AsyncTask} and shows you how to handle concurrency issues.</p> 50 <h2 id="async-task">Use an AsyncTask</h2> 52 <p>The {@link android.os.AsyncTask} class provides an easy way to execute some work in a background 55 android.widget.ImageView} using {@link android.os.AsyncTask} and <a 61 class BitmapWorkerTask extends AsyncTask<Integer, Void, Bitmap> { 91 {@link android.os.AsyncTask} does not prevent the {@link android.widget.ImageView} and anything it 94 android.os.AsyncTask#onPostExecute(Result) onPostExecute()}. The {@link android.widget.ImageView} 111 android.os.AsyncTask} as demonstrated in the previous section. In order to be efficient with memory, 113 android.os.AsyncTask}, there is no guarantee that when it completes, the associated view has no [all...] |
/frameworks/base/test-runner/src/android/test/ |
LoaderTestCase.java | 21 import android.os.AsyncTask; 35 // Force class loading of AsyncTask on the main thread so that it's handlers are tied to 40 new AsyncTask<Void, Void, Void>() { 74 // This handler runs on the "main" thread of the process since AsyncTask 76 // AsyncTask
|
/frameworks/base/docs/html/training/basics/network-ops/ |
connecting.jd | 20 <li><a href="#AsyncTask">Perform Network Operations on a Separate Thread</a></li> 86 <h2 id="AsyncTask">Perform Network Operations on a Separate Thread</h2> 90 thread from the UI. The {@link android.os.AsyncTask} class provides one of the 100 android.os.AsyncTask}. <code>DownloadWebpageTask</code> implements the following 101 {@link android.os.AsyncTask} methods:</p> 105 <li>{@link android.os.AsyncTask#doInBackground doInBackground()} executes 110 <li>{@link android.os.AsyncTask#onPostExecute onPostExecute()} takes the 130 // When user clicks button, calls AsyncTask. 145 // Uses AsyncTask to create a task away from the main UI thread. This task takes a 147 // has been established, the AsyncTask downloads the contents of the webpage a [all...] |
/external/chromium_org/sync/android/java/src/org/chromium/sync/signin/ |
ChromeSigninController.java | 9 import android.os.AsyncTask; 114 new AsyncTask<Void, Void, Void>() { 130 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
/packages/apps/ContactsCommon/src/com/android/contacts/common/util/ |
PhoneNumberFormatter.java | 20 import android.os.AsyncTask; 33 AsyncTask<Void, Void, PhoneNumberFormattingTextWatcher> { 71 .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[]) null);
|
/packages/apps/Dialer/src/com/android/dialer/calllog/ |
ClearCallLogDialog.java | 28 import android.os.AsyncTask; 59 final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
|
/packages/apps/Gallery2/src/com/android/gallery3d/app/ |
GalleryAppImpl.java | 21 import android.os.AsyncTask; 107 // AsyncTask class needs to be loaded in UI thread. 110 Class.forName(AsyncTask.class.getName());
|