You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by navGrpahViewModes(R.id.xxxx) 一般用来获取前面已经入栈的节点的ViewModel,对于已经入栈的节点Graph中已经可以找到了,所以可以使用。但是这里确实有一个小问题:Fragivity中通常并不关心id(实际id是class的hash),所以通过id获取vm不够友好。后期会添加一个不通过id获取vm的API供大家使用。当然非必要的情况,推荐直接使用by activityViewModels()
导航图是动态生成,那么by navGraphViewModels(R.id.xxxx)这个图内作用域共享的ViewModel是不是就没办法使用了?
The text was updated successfully, but these errors were encountered: