Best practice to call a variable from ViewModel
I have this variable in my ViewModel:
private String chosenDay;
and when I want to set the chosen day I use setter function:
public void setChosenDate(String date){
chosenDay = date;
}
and when I want to use it,I use getter:
public String getChosenDay(){
return chosenDay;
}
My question is:
Do you think its a good practice to use getter and setters for the viewModel or I can just access the variable directly from the activity?
viewModel.chosenDay = "Monday"
Thank you !