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

对于获取接口数据static 思考 #59

Open
yuekong opened this issue Dec 4, 2018 · 1 comment
Open

对于获取接口数据static 思考 #59

yuekong opened this issue Dec 4, 2018 · 1 comment

Comments

@yuekong
Copy link

yuekong commented Dec 4, 2018

public static Observable<List> getPhotoList() {
return sNewsService.getPhotoList()
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread());
}
如果获取接口数据都是使用静态方法 不会导致内存溢出吗?如果会,还有什么好的方法来解决这个问题呢?

@Rukey7
Copy link
Owner

Rukey7 commented Dec 5, 2018

不会,实例方法和静态方法一样都要占用内存的,至于什么时候用哪个要看实际开发场景,你网上搜下资料了解下

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

2 participants