Advertisement
irshalfir

Shared View Model Dagger

Oct 22nd, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.44 KB | None | 0 0
  1. On Activity Parent
  2.  
  3. // initialize dagger component
  4. lateinit var goodsDetailComponent: GoodsDetailComponent
  5. goodsDetailComponent = (application as OpoApplication)
  6.             .applicationComponent
  7.             .goodsDetailComponent()
  8.             .create()
  9. // connect activity to component
  10. goodsDetailComponent.inject(this)
  11.  
  12. On Fragment Child
  13. (activity as DetailProductActivity)
  14.             .goodsDetailComponent
  15.             .inject(this)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement