當前位置: 首頁>>代碼示例>>Java>>正文


Java AsyncTask.THREAD_POOL_EXECUTOR屬性代碼示例

本文整理匯總了Java中android.os.AsyncTask.THREAD_POOL_EXECUTOR屬性的典型用法代碼示例。如果您正苦於以下問題:Java AsyncTask.THREAD_POOL_EXECUTOR屬性的具體用法?Java AsyncTask.THREAD_POOL_EXECUTOR怎麽用?Java AsyncTask.THREAD_POOL_EXECUTOR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.os.AsyncTask的用法示例。


在下文中一共展示了AsyncTask.THREAD_POOL_EXECUTOR屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExecutor

/**
 * Returns the Executor used by the SDK for non-AsyncTask background work.
 *
 * By default this uses AsyncTask Executor via reflection if the API level is high enough.
 * Otherwise this creates a new Executor with defaults similar to those used in AsyncTask.
 *
 * @return an Executor used by the SDK.  This will never be null.
 */
public static Executor getExecutor() {
    synchronized (LOCK) {
        if (FacebookSdk.executor == null) {
            FacebookSdk.executor = AsyncTask.THREAD_POOL_EXECUTOR;
        }
    }
    return FacebookSdk.executor;
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:16,代碼來源:FacebookSdk.java

示例2: getCurrentExecutor

public Executor getCurrentExecutor() {
    final DocumentInfo cwd = getCurrentDirectory();
    if (cwd != null && cwd.authority != null) {
        return ProviderExecutor.forAuthority(cwd.authority);
    } else {
        return AsyncTask.THREAD_POOL_EXECUTOR;
    }
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:8,代碼來源:StandaloneActivity.java

示例3: getExecutor

public static Executor getExecutor() {
    synchronized (LOCK) {
        if (executor == null) {
            executor = AsyncTask.THREAD_POOL_EXECUTOR;
        }
    }
    return executor;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:8,代碼來源:FacebookSdk.java

示例4: KanboardAPI

public KanboardAPI(String serverURL, final String username, final String password) throws IOException {
        Authenticator.setDefault(new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(username, password.toCharArray());
            }

        });
        kanboardURL = KanboardAPI.sanitizeURL(serverURL.trim());
        Log.i(Constants.TAG, String.format("Host uses %s", kanboardURL.getProtocol()));
//        threadPoolExecutor = new ThreadPoolExecutor(12, 12, 20, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(256));
        threadPoolExecutor = (ThreadPoolExecutor) AsyncTask.THREAD_POOL_EXECUTOR;
        threadPoolExecutor.setCorePoolSize(12);
        threadPoolExecutor.setMaximumPoolSize(12);
    }
 
開發者ID:andresth,項目名稱:Kandroid,代碼行數:15,代碼來源:KanboardAPI.java

示例5: build

/**
 * Generates the {@link BittrexApiClient}
 * @return A {@link BittrexApiClient}
 */
@NonNull
public BittrexApiClient build() {
    if (downloader == null) {
        downloader = new UrlConnectionDownloader();
    }

    if (executor == null) {
        executor = AsyncTask.THREAD_POOL_EXECUTOR;
    }

    return new BittrexApiClient(this);
}
 
開發者ID:CoryCharlton,項目名稱:BittrexApi,代碼行數:16,代碼來源:BittrexApiClient.java

示例6: executeTask

public void executeTask(Input... params) {
    if (workMode == WorkMode.SYNCHRONOUS) {
        onPreExecute();
        onPostExecute(doInBackground(params));
    } else {
        super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
    }
}
 
開發者ID:erdo,項目名稱:asaf-project,代碼行數:8,代碼來源:AsafTask.java

示例7: executeInPool

public void executeInPool(Params... values) {
    super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, values);
}
 
開發者ID:alibaba,項目名稱:LuaViewPlayground,代碼行數:3,代碼來源:BaseAsyncTask.java

示例8: AsyncTaskLoader

public AsyncTaskLoader(Context context) {
    this(context, AsyncTask.THREAD_POOL_EXECUTOR);
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:3,代碼來源:AsyncTaskLoader.java

示例9: getThreadPool

public static Executor getThreadPool() {
    return AsyncTask.THREAD_POOL_EXECUTOR;
}
 
開發者ID:didi,項目名稱:VirtualAPK,代碼行數:3,代碼來源:RunUtil.java

示例10: PoolSerialExecutor

public PoolSerialExecutor() {
    this(AsyncTask.THREAD_POOL_EXECUTOR);
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:3,代碼來源:PoolSerialExecutor.java

示例11: getParallelExecutor

public static Executor getParallelExecutor() {
    return AsyncTask.THREAD_POOL_EXECUTOR;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:3,代碼來源:ExecutorCompatHoneycomb.java


注:本文中的android.os.AsyncTask.THREAD_POOL_EXECUTOR屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。