Closed nucle closed 6 years ago
@nucle correct, should be able to remove reference to someId
from the Activity
. As Activity
is avaliable in your module you can @Provide
what you need from your Bundle
How do we convert this class to Kotlin?
@nucle
So we don't need to save someID in the activity. What do you think?
Yes that's correct. The sample is pretty old. I'll update it.
@mussa-ibragimov
How do we convert this class to Kotlin?
I normally don't write Dagger modules with Kotlin, specifically modules that have static
provide methods. The reason is that Kotlin doesn't support static
directly in class. We have to use Companion objects which means there's an extra class generated as a singleton + an extra Dagger module generated.
I think we can change this:
to this:
So we don't need to save someID in the activity. What do you think?