codelab-android-hilt
codelab-android-hilt copied to clipboard
Problem when getting context in android Custom View inflated in Fragment
Hello, I have the following configuration using Hilt 2.32-alpha, I set up the annotation @AndroidEntryPoint on a Fragment. This fragment declares a custom view in it's layout.
The problem occurs when I was trying to get context (basically activity) from inside the Custom view class and I'm getting FragmentContextWrapper: this class is not intended to be used outside the Hilt components as mentioned in the documentation.
So I'm trying to figure out how to get the context correctly or if I'm doing something wrong in the hilt implementation ? Otherwise, I want to verify if this is this is a know bug in the hilt implementation.
Thank for your help. Messid
I think this issue should be filed in https://github.com/google/dagger if this is still happening. Can you inject @ActivityContext?
Filed it in https://github.com/google/dagger/issues/3417