SHARE
TWEET

Untitled

a guest Dec 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. val userIdLiveData:MutableLiveData = ...;
  2. val userLiveData:LiveData = Transformations.switchMap(userIdLiveData, id ->
  3.     repository.getUserById(id)); // LiveData를 리턴합니다.
  4.  
  5. fun setUserId(userId:String) {
  6.      this.userIdLiveData.setValue(userId);
  7. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top