AutorÃa | Ultima modificación | Ver Log |
package com.cesams.twogetskills.viewmodel;import androidx.lifecycle.MutableLiveData;import androidx.lifecycle.ViewModel;import com.cesams.twogetskills.entity.Capsule;import java.util.ArrayList;public class CapsuleViewModel extends ViewModel {private MutableLiveData<ArrayList<Capsule>> capsuleLiveData;private ArrayList<Capsule> capsuleArrayList;public CapsuleViewModel() {capsuleArrayList = new ArrayList<>();capsuleLiveData = new MutableLiveData<>();capsuleLiveData.setValue(capsuleArrayList);}public MutableLiveData<ArrayList<Capsule>> getCapsuleMutableLiveData() {return capsuleLiveData;}public ArrayList<Capsule> getCapsuleArrayList() {return capsuleArrayList;}}