Skip to content

自己封装的一个retrofit2.0+okHttp3+rxjava的网络请求工具类,拿过去直接可以使用

Notifications You must be signed in to change notification settings

withyi9223/RetrofitTest

Repository files navigation

RetrofitTest

自己封装的一个retrofit2.0+okHttp3+rxjava的网络请求工具类,拿过去直接可以使用

如下: public class MainActivity extends AppCompatActivity {

@BindView(R.id.tv_test)
TextView mTvTest;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);


    getDatas();

}

private void getDatas() {

    HttpUtils.execute(RestClient.getApiService().getWeatherDatas("allchina"),
            new BaseSubscriber<Weather>(this, true) {
                @Override
                public void onNext(Weather weather) {
                    mTvTest.setText(weather.city_info.get(5).city);
                    LogUtils.e(weather.city_info.get(1).prov);
                }
            });

}

}

About

自己封装的一个retrofit2.0+okHttp3+rxjava的网络请求工具类,拿过去直接可以使用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages