Infomaniak / android-kDrive

https://play.google.com/store/apps/details?id=com.infomaniak.drive
GNU General Public License v3.0
102 stars 11 forks source link

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

Closed LunarX closed 3 months ago

LunarX commented 3 months ago

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

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud