Skip to content

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

@Fxy4ever

Description

@Fxy4ever
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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions