I am creating Adapter (for Recyclerview) using MVVM structure in Android, where I have created ViewModel class for each item of recyclerview. now I want to call an API on Onclick() method of recyclerview in android.
I cannot call API in recyclerview's itemViewModel so i have to call the api using Activity view Model.
what is the best way to do this?
i am following this example on git: https://github.com/MindorksOpenSource/android-mvvm-architecture/tree/master/app/src/main/java/com/mindorks/framework/mvvm