سؤال

I learned how to create Application-scoped ObjectGraph, and @Inject into my Views 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 Views 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

هل كانت مفيدة؟

المحلول

I ended up using Mortar for that https://github.com/square/mortar

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top