0
rxjava2でretrofit2を使用しています。エラー表示:io.reactivex.Observable用のコール・アダプタを作成できません。<POJO>
ほとんどの場合、私のグラデーションで最新のライブラリを使用していますが、アダプタを作成するための多くの方法を試しました。
私はまた、いくつかのカスタムアダプタを作成しましたが、何もそれが
サービスで動作するように思わない:私は多くのアダプタを試してみました
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() {
}
});
です。 私もこのリンクでstackoverflow solution
私はコードを試してみましたあなたは提案しましたが、うまくいきません。 – Sushrita
あなたのApiInterface.claは何ですか? ss? – eurosecom
パブリックインターフェイスApiInterface {@GET( "category-video.php") Observable