I\'m trying to create an AlertDialog, by using the Builder and setting a custom view. When I try to inflate the view inside of onCreateDialog, I get a StackOverflowError..
You should use LayoutInflater.from(getContext()).
LayoutInflater.from(getContext())
If you are using viewbindings you can call it like this:
viewbindings
binding = FragmentOtpDialogBinding.inflate(LayoutInflater.from(getContext()));