Created
December 14, 2017 16:31
-
-
Save denisviana/485de2468e04bf6f80548c37b65952b9 to your computer and use it in GitHub Desktop.
Teste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public LiveData<MyObject> getMyObject(){ | |
if(mylivedata == null){ | |
mylivedata = new MutableLiveData<MyObject>; | |
doHttpRequest(); | |
} | |
return mylivedata; | |
} | |
public void doHttpRequest(){ | |
// rx http request code | |
onNext(MyObject myobject){ | |
mylivedata.setValue(myobject) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment