当前位置: 首页>>代码示例>>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;未经允许,请勿转载。