Open SomnusWu opened 7 years ago
Add this to your app gradle :
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
Update your retrofit builder :
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://api.example.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
thanks
@alouanemed but , Still not running . url : https://github.com/SomnusWu/AndroidHttpDemo.git
Update this :
With this :
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
楼主大大 我用的是RxJava2.0 RxAndroid2 .0
compile 'io.reactivex.rxjava2:rxandroid:2.0.0' compile 'io.reactivex.rxjava2:rxjava:2.0.0'
BookListModel.java改为
然后把Fun1改为了
就报了如下错误:
Caused by: java.lang.IllegalArgumentException: Unable to create call adapter for io.reactivex.Observable<com.somnus.androidhttpdemo.ui.entity.HttpResultBase<java.util.List<com.somnus.androidhttpdemo.ui.entity.BookListDto>>> for method HttpServiceApi.getBookList
问下大大该怎么修改啊 。ths