GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Retrofit2-Rxjava2/README.md at master · binbinLibrary/Retrofit2-Rxjava2

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (28 loc) · 1.04 KB
/

README.md

Copy path

File metadata and controls

35 lines (28 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Retrofit2-Rxjava2

对Retrofit2-Rxjava2联网的封装,针对一般的联网请求,弹窗,取消请求,页面关闭取消订阅

优点

1、尽可能简洁
2、可控制不同请求的加载框,
3、错误统一处理
4、页面销毁时取消订阅
5、可根据不同请求处理不同的异常

示例

 Api.getDefaultService()
                .calendarBean("2017-06-29")
                .map(new RxFunction<Calendar>())
                .compose(RxSchedulers.<Calendar>io_main())
                .subscribe(new RxObserver<Calendar>(this, TAG, 0, false) {
                    @Override
                    public void onSuccess(int whichRequest, Calendar calendar) {
                        tv_.setText(calendar.getLunar());
                    }

                    @Override
                    public void onError(int whichRequest, Throwable e) {

                    }
                });

配合MVP效果更佳,请查看代码示例

详情参看:http://blog.csdn.net/y12345654321/article/details/73920581

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.