Java Code Examples for android.os.AsyncTask#SERIAL_EXECUTOR

The following examples show how to use android.os.AsyncTask#SERIAL_EXECUTOR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Coordinator.java    From ACDD with MIT License 5 votes vote down vote up
@TargetApi(11)
static Executor getDefaultAsyncTaskExecutor() {
    if (VERSION.SDK_INT >= 11) {
        return AsyncTask.SERIAL_EXECUTOR;
    }
    try {
        Field declaredField = AsyncTask.class.getDeclaredField("sExecutor");
        declaredField.setAccessible(true);
        return (Executor) declaredField.get(null);
    } catch (Exception e) {
        return null;
    }
}
 
Example 2
Source File: BaseAsyncTask.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
public void executeSerial(Params...values){
    super.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, values);
}
 
Example 3
Source File: ThreadUtils.java    From Android-BLE with Apache License 2.0 4 votes vote down vote up
private ThreadUtils() {
    mParallelExecutor = THREAD_POOL_EXECUTOR;
    mSerialExecutor = AsyncTask.SERIAL_EXECUTOR;
}
 
Example 4
Source File: TabPersistentStore.java    From delion with Apache License 2.0 4 votes vote down vote up
private Executor getPrefetchExecutor() {
    return sMigrationTask == null ? AsyncTask.THREAD_POOL_EXECUTOR : AsyncTask.SERIAL_EXECUTOR;
}
 
Example 5
Source File: TaskExecutor.java    From LLApp with Apache License 2.0 4 votes vote down vote up
private TaskExecutor() {
    mParallelExecutor = THREAD_POOL_EXECUTOR;
    mSerialExecutor = AsyncTask.SERIAL_EXECUTOR;
}