Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the activity is in the background, the survey cannot be displayed #95

Open
breakwhile opened this issue Nov 12, 2020 · 0 comments
Open

Comments

@breakwhile
Copy link

breakwhile commented Nov 12, 2020

Summary
I set wootric on the main activity. When we call wootric.survey(), and then put the app in the background or start a new activity, survey cannot be displayed when returning to main activity after waiting for the data request, and an error will be displayed on the console: WOOTRIC_SDK: showSurvey: Can not perform this action after onSaveInstanceState()

Expected Behavior
When returning to main activity, survey can be displayed.

Wootric Version
2.18.0

Root Cause
When the activity starts in the background, onSaveInstanceState (Bundle outState) will be called, and then FragmentTransaction.commit () will throw this exception
image

image

Solution
Use commitAllowingStateLoss() to solve this issue most easily, but you can get more answers from here:
https://medium.com/mobile-app-development-publication/handling-illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-d4ee8b630066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant