sharedViewModel, how to access from Activity

前端 未结 0 603
悲&欢浪女
悲&欢浪女 2021-01-02 20:20

I have a problem with my Fragment and ViewModel. This is the code in my Fragment:

       private val sharedViewModel: SharedViewModel by activityViewModels()
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题