tough1985 / rxjavaretrofitdemo Goto Github PK
View Code? Open in Web Editor NEWA demo show how to use Retrofit with Rxjava
License: MIT License
A demo show how to use Retrofit with Rxjava
License: MIT License
GithubService.getInstance()
.createGithubService()
.contributors("square","retrofit")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new ProgressSubscriber<List>(RetrofitActivity.this) {
@OverRide
protected void nextReponse(String result) {
Log.i("xxxxxxxxxx:",result);
}
});
如果网络请求很快的情况下,进度条就会闪一下出现请求的结果,怎么优化这个进度条闪一下的问题?比如说如果很快的话就把进度条隐藏,如果请求不是那么快的话就显示进度条。
收获很大。希望作者可以出更多优秀的项目。
例如:我需要请求2个接口,第二个接口需要第一个接口得到的返回值作为参数,这样如何实现?
封装后感觉和原来用回调似乎变成一样的了
有内存泄漏问题,仅仅测试一个Activity,内存泄漏就会出现,关键在于ew ProgressSubscriber(getTopMovieOnNext, MainActivity.this)传递了MainActivity.this,并传给handler,我觉得这样做不太合适,在Android里handler内存泄漏是一个比较突出的地方,最好是dialog传递消息部分不用handler较为合适。
想着不错的样子
对话框会连续展示好几个
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.