Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Attachment actions
Description
Steps to reproduce:
add animated icon to splashscreen api
and add listener for splashscreen exit
perform action that will recreate activity (ex. change UI dark mode using quick settings tile)
check with profiler for leaks
What is wrong
It looks like SurfaceView (SplashScreen.iconView) is leaking context, that is Activity for every instance where there is onExitAnimationListener set.
Not using listener DOES help (no more leaks), but then there is no way of performing custom exit animations or related logic.
clearing onExitAnimation after it is fired DOES NOT help - leak is still there
using androidx.core-splashscreen:1.0.1 DOES NOT help
Bug seen on:
Bug was not present on:
resolution
This bug looks like OS bug, but as it seem to be fixed in later version of Android 13, then maybe there is a way to fix it in backward compatible way in this library?
I tried couple of things and tried to find in android source code what is wrong, but with no luck.
attachments:
anim_launcher_foreground.xml
- sample animated vector drawableSplashScreenLeak.zip
- sample project