Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问新版LiteHttp怎么用,没有了newApacheHttpClient() #29

Open
huangboheng opened this issue Nov 29, 2016 · 3 comments
Open

请问新版LiteHttp怎么用,没有了newApacheHttpClient() #29

huangboheng opened this issue Nov 29, 2016 · 3 comments

Comments

@huangboheng
Copy link

文档没更新,protected的构造函数也不能new出来,也没有单例的方法

@CB2Git
Copy link

CB2Git commented Jan 19, 2017

请问你解决了么,我在源码里面就看到一个build,但是其实就是直接返回了了HttpConfig对象,并没有初始化里面的config成员变量

public class LiteHttp {

private static final String TAG = LiteHttp.class.getSimpleName();

protected HttpConfig config;
protected final Object lock = new Object();
protected StatisticsInfo statisticsInfo = new StatisticsInfo();
protected AtomicLong memCachedSize = new AtomicLong();
protected ConcurrentHashMap<String, HttpCache> memCache = new ConcurrentHashMap<String, HttpCache>();

public static HttpConfig build(Context context) {
    return new HttpConfig(context);
}

protected LiteHttp(HttpConfig config) {
    initConfig(config);
}

@flyjin
Copy link

flyjin commented Feb 28, 2017

可以.create

@feiyuu
Copy link

feiyuu commented May 15, 2017

新的创建对象的方式
HttpConfig config = LiteHttp.build(context)
.setDebugged(false)
.setDetectNetwork(true)
。。。

LiteHttp liteHttp = config.create();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants