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

if anyone wants to refresh the data, you can't put mutableLiveData into a method #6

Open
Fxy4ever opened this issue Aug 24, 2018 · 0 comments

Comments

@Fxy4ever
Copy link

Fxy4ever commented Aug 24, 2018

public LiveData<List<Project>> getProjectList(String userId) {
        final MutableLiveData<List<Project>> data = new MutableLiveData<>();
      
like this, if you use the method to refresh data, you can only get a new mutableLiveData which can't be observed the change ,you should put mutableLiveData out of the method.

        //something...

        return data;
    }
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

1 participant