Answer the question
In order to leave comments, you need to log in
How to befriend c (Realm + RxAndroid)?
There are no docks on this topic, only a tiny example on the off site realm which is not enough for me.
In Retrofit, I did this:
Service interface -
@GET("some_parn_of_url/")
Observable<List<Обьект>> getObjectsObservable();
Service service = getService.getObjectsObservable()
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<Object>() {
@Override
public final void onCompleted() {
// do nothing
}
@Override
public final void onError(Throwable e) {
Log.e("GithubDemo", e.getMessage());
}
@Override
public final void onNext(Objectresponse) {
mCardAdapter.addData(response);
}
});
Answer the question
In order to leave comments, you need to log in
Well, here it seems to be described in detail how to work with RxJava + Realm.
https://realm.io/news/using-realm-with-rxjava/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question