We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Network.getGankApi() .getBeauties(100, 1) .subscribeOn(Schedulers.io()) .map(GankBeautyResultToItemsMapper.getInstance()) .doOnNext(new Action1<List>() { @OverRide public void call(List items) { Database.getInstance().writeItems(items); } }) .subscribe(new Action1<List>() { @OverRide public void call(List items) { cache.onNext(items); } }, new Action1() { @OverRide public void call(Throwable throwable) { throwable.printStackTrace(); } }); 从网路获取数据后执行doOnNext先写入数据库,然后才执行subscribe里的call,这样就是网络获取数据后先写数据库再更新UI,我理解的没错吧? 实际应用中这种方式应该不可取吧,rxjava新手,这种类型的需求应该很普遍吧,实际应该应该怎么使用呢
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Network.getGankApi()
.getBeauties(100, 1)
.subscribeOn(Schedulers.io())
.map(GankBeautyResultToItemsMapper.getInstance())
.doOnNext(new Action1<List>() {
@OverRide
public void call(List items) {
Database.getInstance().writeItems(items);
}
})
.subscribe(new Action1<List>() {
@OverRide
public void call(List items) {
cache.onNext(items);
}
}, new Action1() {
@OverRide
public void call(Throwable throwable) {
throwable.printStackTrace();
}
});
从网路获取数据后执行doOnNext先写入数据库,然后才执行subscribe里的call,这样就是网络获取数据后先写数据库再更新UI,我理解的没错吧?
实际应用中这种方式应该不可取吧,rxjava新手,这种类型的需求应该很普遍吧,实际应该应该怎么使用呢
The text was updated successfully, but these errors were encountered: