Created
July 2, 2020 07:34
-
-
Save manuelvicnt/55132814c402ea5a9276dafed3e5ea86 to your computer and use it in GitHub Desktop.
Adding components to the Hilt hierarchy - 4
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
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
// Injected by ActivityComponent | |
@Inject lateinit var userManager: UserManager | |
// Populated by UserComponent | |
private lateinit var userDataRepository: UserDataRepository | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
userDataRepository = EntryPoints.get( | |
userManager.userComponent, UserComponentEntryPoint::class.java | |
).userDataRepository() | |
// Do something with userDataRepository | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment