I ended up using Mortar for that https://github.com/square/mortar
Fragment-scoped ObjectGraph
-
14-06-2023 - |
Question
I learned how to create Application
-scoped ObjectGraph
, and @Inject
into my View
s from it.
Then I learned how to create Activity
-scoped ObjectGraph
, and @Inject
into my View
's from an Activity
's Context
.
Now I need to learn how to create a Fragment
-scoped ObjectGraph
, since Fragment
is not a Context
and is not injected into my View
s by the LayoutInflater
.
As I see the problem: I need a way to reference a Fragment
from inside a View
, but I think this is essentially wrong, and I need another solution
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow