本文整理匯總了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;
}
示例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;
}
}
示例3: getExecutor
public static Executor getExecutor() {
synchronized (LOCK) {
if (executor == null) {
executor = AsyncTask.THREAD_POOL_EXECUTOR;
}
}
return executor;
}
示例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);
}
示例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);
}
示例6: executeTask
public void executeTask(Input... params) {
if (workMode == WorkMode.SYNCHRONOUS) {
onPreExecute();
onPostExecute(doInBackground(params));
} else {
super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
}
}
示例7: executeInPool
public void executeInPool(Params... values) {
super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, values);
}
示例8: AsyncTaskLoader
public AsyncTaskLoader(Context context) {
this(context, AsyncTask.THREAD_POOL_EXECUTOR);
}
示例9: getThreadPool
public static Executor getThreadPool() {
return AsyncTask.THREAD_POOL_EXECUTOR;
}
示例10: PoolSerialExecutor
public PoolSerialExecutor() {
this(AsyncTask.THREAD_POOL_EXECUTOR);
}
示例11: getParallelExecutor
public static Executor getParallelExecutor() {
return AsyncTask.THREAD_POOL_EXECUTOR;
}