S
S
Sarrius2016-06-08 12:09:37
Android
Sarrius, 2016-06-08 12:09:37

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();

Then in the controller
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);
                            }
                        });

Realm won't work like that.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Pavlovsky, 2016-06-08
@TranE91

What is the question?

D
Denis Zagaevsky, 2016-06-08
@zagayevskiy

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 question

Ask a Question

731 491 924 answers to any question