Illegal state exception when DialogFragment is injected using Hilt

117 Views Asked by At

App crashes, when application comes to foreground on CustomDialog Fragment transaction.

Hello everyone, I am using Hilt to inject a dialog fragment instance, which is shown on API response. If user push application to background and then bring it to foreground, then app crashes while showing the dialog fragment on api response. This issue resolves if the fragment instance is created manually. Thanks in advance for your help.Instance of DialogFragment injected through hilt Custom Dialog Fragment Class Header that was injected using hilt

Fragment being utilized on api response

error while showing the fragment

0

There are 0 best solutions below