I'm using a third-party library that has some custom view implementations. In the implementation, they call Utils.showSoftKeyboard(context as Activity)
. This, along with using the fragment as an @AndroidEntryPoint causes the following exception:
java.lang.ClassCastException: dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper cannot be cast to android.app.Activity
.
Is there any way to fix this without altering the third-party library?
Without Hilt Dependencies we can access parent activity as below
(context as ContextWrapper).baseContext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With