I have this code where I show Dialog Fragment when clicking a viewHolder item in Adapter
SpecialRequestNotFoundBottomSheetDialog {
requestItem?.specialRequestEntity?.id?.let { id -> onCancelReasonsSelected(id, it) }
}.show(itemView.context as AppCompatActivity).supportFragmentManager)
recently I'm migrating to Hilt and I got class cast exception, looks like Hilt wrapping the context and I can't get the parent Activity to get the required FragmentManager to show the Dialog
I read source code find this solution FragmentComponentManager.findActivity(view.context) as Activity