Q:

Continue Animation Into Sub Activity

I want to provide an animated background for my app for all activities. I am using the following guide:
https://medium.com/@joonasm.kauppinen/animated-gradient-background-on-android-part-1-2-82f378257610
It works nicely, but whenever I go into a sub activity, the animation starts over. I want to be able to continue the animation from main activity into sub activity and back. Is this possible?
Thanks.

A:

This is not possible. Even if reflection is used to access and set current frame. It will not work in the case above. Even if the AnimationDrawable was created programmatically and it was shared between both of the activities. It will not work either. Some developers suggested using a background on main activity and suggested that it would be shared on child activities. That is not how activities work. Even if there was a way to achieve the sharing of animation, the app would have out of memory issues.
TL;DR It is not possible.

