-
Notifications
You must be signed in to change notification settings - Fork 242
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
State not reloaded #260
Comments
With further digging it seems that InternalLifecycleIntegration.onActivityCreated() is always called with a null bundle, thus it is unable to load. However I clearly see that a reasonable bundle (with the right screen objects) is being created in InternalLifecycleIntegration.onSaveInstanceState() and added to the outState bundle. But it seems like the OS just doesn't resupply the saved bundle in onActivityCreated. Any idea why this would happen? FYI I am using a Pixel emulator with API 25. Also tried a Motorola Nexus 6 (not emulator) with API 24 and same results. Is the idea of Flow that it only saves/restores the state during the onStop/onStart events, and not the onDestroy/onCreate events? I do see the state being restored in onStop/onStart, however the implication I had by reading the docs is that it would be persisted across the FULL lifecycle (ie create/destroy). Is that a false reading of the docs? |
Bundle will be non-null if you put the application in background with HOME, click the "terminate application" button in Android Studio, then relaunch the app from launcher. This is how you can simulate low memory condition behavior. |
I've configured Flow in my single-activity app according to the documentation. The backstack works correctly and I can see via the debugger that the stack is saved out when the app is closed.
However, when I reopen the app the InternalLifecycleIntegration.load() function is never called.
In my Activity I can see that the normal onCreate, onStart, onResume lifecycle is followed.
Why would the app not reload the saved state?
The text was updated successfully, but these errors were encountered: