setViewModel method is not available


#1

mBinding.setViewModel(new SoundViewModel(mBeatBox));

would you help me please


#2

Make sure you’ve updated your XML to list add a variable. The variable is called ‘viewmodel’ so a setViewModel method is generated for you.


#3

I have the same issue. I have done everything as specified and even rebuilt the project. But the problem persists. Any ideas?


#4

Solved. Just had to close and reopen Android Studio