0

here is the case:

  1. I have 2 git repos, let's say ParentRepo and ChildRepo
  2. ParentRepo will call classes in ChildRepo
// In ChildRepo, here is the main entry class
class MyController(
   val context: Context,
   val player: Player,
   ...
) {...}

my question is that, MyController is being initialized by parent repo, meaning context and player is being passed in where it is being called in parentRepo.

If I want to use Dagger in the ChildRepo, how would I build or provides the instance for Player or Context in ChildRepo or is there any other way?

(I would like to use Dagger on my ChildRepo since it is also very big and having a lot of classes, but since MyController is the entry point, it doesn't seem possible to @Inject constructor successfully further down, the Player and Context will be used as contructor parameter for other classes in ChildRepo)

Appreciate for your time!

Ryan Chen
  • 170
  • 1
  • 7
  • https://stackoverflow.com/questions/59694921/android-using-dagger2-with-multiple-project-modules this one has the similar issue, so posted here. – Ryan Chen Mar 11 '23 at 16:38

0 Answers0