Skip to content

Instantly share code, notes, and snippets.

@varundwarkani
Created June 13, 2021 08:32
Show Gist options
  • Save varundwarkani/4eaf941f49cf9c27b2061353faa040c6 to your computer and use it in GitHub Desktop.
Save varundwarkani/4eaf941f49cf9c27b2061353faa040c6 to your computer and use it in GitHub Desktop.
public class UPIViewModel extends ViewModel {
public MutableLiveData<String> upiID = new MutableLiveData<>("");
public SingleLiveEvent<Boolean> isSubmitAction = new SingleLiveEvent<>();
public SingleLiveEvent<Boolean> canSaveData = new SingleLiveEvent<>();
public void onSubmit() {
isSubmitAction.postValue(true);
}
public void onCancel() {
isSubmitAction.postValue(false);
}
}
@girubhai
Copy link

girubhai commented Oct 7, 2021

SingleLiveEvent is not found, i.e. what gradle dependency need to add SingleLiveEvent ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment