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

Workaround for DEV-1351 #198

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

louischan-oursky
Copy link
Contributor

ref DEV-1351

It is unnecessary. We haven't add the web view to the parent yet.
Comment on lines +90 to +96
// This flag is used to work around an issue of fragment re-creation.
// When this fragment is used with androidx.navigation,
// this fragment may be onDestroyView(), and then onCreateView() again.
// If that happens, the webView may never has its load() called.
// However, even with this fix, savedInstanceState was never called, so
// the webView will show the initial screen.
private var waitWebViewToLoadIsCalledInThisLifecycle: Boolean = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it means sometimes onDestroyView will be called but onSaveInstanceState won't call?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://developer.android.com/guide/fragments/lifecycle#states
onSaveInstanceState is always called before calling onDestroyView
So on onCreateView the webview should be able to restore the state 🤔

@tung2744 tung2744 merged commit 4424890 into authgear:2023C01-2024-07-10 Aug 12, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants