-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Screen State not getting retained #372
Labels
Comments
techjd
changed the title
Screen State not getting reatined
Screen State not getting retained
Mar 22, 2024
Have you tried setting |
All Voyager screen has to be serializable in a Bundle, this means that you need to all parameters of your Screen for Android to be or Java Serializable or Parcelable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am working on a project with 5 tabs. I have a Home tab, which displays a list of products. Clicking on any product takes you to the detail page. Initially, my problem was in navigating to the detail screen. It works perfectly with nested navigation, but I wanted to hide the bottom nav bar and top app bar.
Initially, I followed the approach mentioned in this discussion thread: #322.
It did work, but I had to pass lambda as a parameter to the screen, which caused crashes on Android due to
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object.
I quickly changed my approach and navigated to the DetailedScreen using the parent navigator: #204 (comment).
However, I am facing an issue where the screen state is not retained when navigating back on Android, although on iOS, the screen state is retained. This problem is also faced in rest of the tabs. Are there any fixes for this?
You can observe in the video that the list state is getting changed on Android. My current approach can be found here
problem.mp4
The text was updated successfully, but these errors were encountered: