Hi everyone,
Let’s say I start an activity with some bundled data that I’d need way back in the repository. How can I provide that data using Hilt instead of passing it through several ${place_arch_pattern}-components? How do you solve problems like that?
g
gildor
07/17/2020, 1:48 AM
You can access Activity in ActivityScope module, and get intent data from it
c
Christian Maier
07/17/2020, 4:47 AM
That way I’ll reference the activity in my repo. I’d like work around this.
g
gildor
07/17/2020, 5:14 AM
no need to do this on level of repo
gildor
07/17/2020, 5:15 AM
add this info to your scope
@Named(“some_id”)
fun provideId(activity: Activity): String = activity.intent.getStringExtra(“some_id_arg”)