You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep the Android host Activity alive when a backgrounded survey auto-closes #94
When the Android host app goes to the background while a survey is on its ending (“Thank you”) card, the survey can auto-close after the fragment state has been saved. The SDK's FormbricksFragment.safeDismiss() then calls activity?.finish(), closing the host Activity; returning from Recents starts the app fresh. The same fallback also runs if dismissal throws. The SDK should not terminate its host to dismiss its own survey.
Goal
Dismiss or defer dismissal of only the survey sheet across background/foreground transitions without finishing the host Activity.
Done when
Auto-close on the ending card while the Activity is backgrounded does not finish or restart the host; returning to the app leaves the host usable and the survey closes safely.
Normal foreground auto-close and user-initiated close still dismiss the survey, without leaving an intercepting sheet or duplicate survey on resume.
A saved-state or dismissal-error path never terminates the host Activity; lifecycle regression coverage exercises both foreground and background closure where feasible.
Technical context
Verified against formbricks/android current main: android/src/main/java/com/formbricks/android/webview/FormbricksFragment.kt routes the WebView close callback through safeDismiss() and calls activity?.finish() both when the fragment is not added/state is saved and in its exception handler. dismissAllowingStateLoss() is one reporter-suggested approach, not an agreed requirement. Android instrumented fragment tests exist under android/src/androidTest/java/com/formbricks/android/webview/.
changed the title [-]Survey auto-close while the app is in the background calls activity.finish() and closes the host Activity[/-][+]Keep the Android host Activity alive when a backgrounded survey auto-closes[/+]on Oct 12, 2026
Activity
[-]Survey auto-close while the app is in the background calls activity.finish() and closes the host Activity[/-][+]Keep the Android host Activity alive when a backgrounded survey auto-closes[/+]ivy-formbricks commentedon Nov 9, 2026
The fix is merged into
mainin #99 and will ship with the next release.