I am using retrofit2 with rxjava2.
I have used mostly the latest library in my gradle and I have tried many methods for creating adapter .
I have also created some custom adapter but nothing seems to work with it
service :
public static Retrofit getClient() {
if (retrofit==null) {
retrofit = new Retrofit.Builder().baseUrl(AppConstants.BASE_URL)
.addConverterFactory(GsonConverterFactory.create()).
addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build();
}
return retrofit;
}
fragment code:
ApiInterface apiInterface
=ApiClient.getClient().create(ApiInterface.class);
apiInterface.getCategoryVideos(AppConstants.API_KEY)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<Video>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Video value) {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
I have tried many adapters but no adapter is working . I am
the log output is :
Any suggestion or solution is appreciated . I have also tried the solution in this link stackoverflow solution