Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freshly Cloned Doesn't Show Anything #3

Open
Ep0chalypse opened this issue Dec 23, 2016 · 2 comments
Open

Freshly Cloned Doesn't Show Anything #3

Ep0chalypse opened this issue Dec 23, 2016 · 2 comments

Comments

@Ep0chalypse
Copy link

Ep0chalypse commented Dec 23, 2016

Hi and first off thanks for creating this repository and the accompanying blog posts explaining it! I'm trying to learn rxjava/mvp/content providers and this is great.

I can't seem to get this app to work. On a freshly cloned version the app starts up but does not display anything on the ui. From my limited knowledge of how DP works and MVP it seems the remote datastore is never called. If I manually call getPost() on the AppRemoteDataStore it works properly and fetches data

'AppRemoteDataStore remote = new AppRemoteDataStore();

    remote.getPost().subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<List<Post>>() {
                @Override
                public void call(List<Post> posts) {
                    Log.d(TAG, "MainActivity hack: " + posts.size());
                }
            });`

I'd love to play around with this app more and continue my learning, but I've pretty much hit a wall here and I can't figure out the issue.

@johninvictus
Copy link

I have the same issue, it seems the rx concat is not calling the remote data

@VictorHerreraO
Copy link

VictorHerreraO commented Mar 6, 2018

I followed also this tutorial some time ago and had a similar problem. After reading about Observables I realized that when using Observable.concat() the next emiting source is called only after the previous one has finished, hence quering the database and returning asRxObservable() gives us a listener to the database that has no end, so .concat never calls the next observable. An easy fix is to replace asRxObservable() with executeAsBlocking() and emit the resulting list using Observable.just().

Hope this helps someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants