Skip to content

RequestQueue.start 异常求解决方案, 急 #26

@JasonMiss

Description

@JasonMiss

java.lang.IllegalThreadStateException
Thread already started
com.duowan.mobile.netroid.RequestQueue.start(RequestQueue.java:128)

代码块:
public static RequestQueue init(Context ctx) {
if (mRequestQueue == null) {
// 创建Netroid主类,指定硬盘缓存方案
Network network = new BasicNetwork(new HurlStack(null), HTTP.UTF_8);
mRequestQueue = new RequestQueue(network, RequestQueue.DEFAULT_NETWORK_THREAD_POOL_SIZE, new DiskCache(
new File(ctx.getCacheDir(), DEFAULT_CACHE_DIR), HTTP_DISK_CACHE_SIZE));
// 注:ImageLoader及FileDownloader不是必须初始化的组件,如果没有用处,不需要创建实例
mFileDownloader = new FileDownloader(mRequestQueue, 1);

        mRequestQueue.start();
    }
    return mRequestQueue;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions