Android ViewModel call Activity methods

前端 未结 3 567
执念已碎
执念已碎 2020-12-31 08:13

I\'m using android AAC library and Android databinding library in my project. I have AuthActivity and AuthViewModel extends android\'s ViewModel class. In some cases i need

3条回答
  •  爱一瞬间的悲伤
    2020-12-31 08:28

    well your approach is quite good. But somehow your interface depends on the activity means if you are reusing your view these interface makes no use or may be for that scenario you have to create new interface to solve your problem.

    But if you create an instance of Activity then you have control of it.

提交回复
热议问题