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

Avoid filling up save state bundle endlessly because of the ViewPager2 #1346

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

LunarX
Copy link
Contributor

@LunarX LunarX commented Jul 1, 2024

As you scroll the preview viewpager a lot, the bundle that stores its state for when the view is recreated due to a configuration change increases endlessly. At some point the bundle can become too large and trigger a TransactionTooLargeException.

To avoid this, we can ask the ViewPager2 to not save its state for recreation and instead start over from a blank slate. This apparently doesn't remove any feature in our case and seems to be fixing the issue

@LunarX LunarX added the bug Something isn't working label Jul 1, 2024
@LunarX LunarX requested a review from sirambd July 1, 2024 07:26
@LunarX LunarX self-assigned this Jul 1, 2024
@LunarX LunarX force-pushed the prevent-viewpager2-transaction-too-large branch from ffc3a29 to 650a535 Compare July 8, 2024 13:50
@LunarX LunarX enabled auto-merge July 8, 2024 13:51
Copy link

sonarcloud bot commented Jul 8, 2024

@LunarX LunarX merged commit 7d5ef5e into master Jul 8, 2024
4 checks passed
@LunarX LunarX deleted the prevent-viewpager2-transaction-too-large branch July 8, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants