Last active
November 7, 2017 19:17
-
-
Save rachitmishra/8e3af3358a40c5e93962dfd2719e5b41 to your computer and use it in GitHub Desktop.
dagger-android-fragment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fragment with dependency `ConnectionUtils` | |
*/ | |
class HomeFragment: Fragment() { | |
@Inject | |
lateinit var connectionUtils: ConnectionUtils // Requesting our dependency | |
override fun onAttach(context: Context?) { | |
AndroidSupportInjection.inject(this) // Providing the dependency | |
super.onAttach(context) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment