Resolve Fragment's activity in fragment scope? #1666
Unanswered
carterhudson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have some google sign in stuff that requires access to an Activity, but I want to abstract it away as
SaveEmailAuthCredentials
and hand it to myViewModel
. To avoid memory leaks, I'd like to use scopes. As such, my module looks like this:My understanding is that
androidContext
should resolve the closest context to the scope, which would be theEmailAuthFragment
's Activity. However, when I useandroidContext()
here, it's retrieving the Application Context. Do I need to somehow nest my Fragment scope within an Activity scope in order to have access to the Activity?Beta Was this translation helpful? Give feedback.
All reactions