Cannot create an instance of custom ViewModel

前端 未结 6 1446
孤街浪徒
孤街浪徒 2020-12-11 01:26

I am using dagger2 library. whenever I am trying to run my project is says not able to create instance of view model class.

main activity where I am trying to create

6条回答
  •  囚心锁ツ
    2020-12-11 01:44

    Need to add below code in all activity if you use multiple activity

    AndroidInjection.inject(this);
    

提交回复
热议问题