Issue
Can I use setOnClickListener in MVVM pattern? Or is it better to just use xml's onClick?
Solution
The setOnClickListener function can be used anywhere in kotlin class like activity, fragment, or adapter regardless of the design pattern. And it's the better approach than using onClick on your XML files
Answered By - galihif
Answer Checked By - Willingham (JavaFixing Volunteer)