I want quite simple thing - to know when is my activity completely loaded and presenting itself on the screen - that is when I want a piece of code to run. That piece of code starts by taking a screenshot and running some animations on it. I wrote that code in onResume() and everything is fine during normal start up, but when I rotate the device the screenshot is taken from the previous orientation, although all the display parameter dumps show that the orientation is already changed. It seems like the system re-creates, re-runs and re-draws my Activity still physically showing the previous state and then it runs the system rotation animation between 2 states and finally shows my Activity. This also implies that any android app starting any animation in onResume will lose the first X milliseconds of it because of the system rotation animation (X can be of 3 different values depending on rotation). I tried over 40 on...() functions like onAttachedToWindow() but they are all called too early. Waiting some time before starting is not good since I will have latency during normal start up and the waiting time is not well defined.
Since I am part of the system I have one solution by adding some codes deep in the window manager which I can ask to know if system rotation animation is running, but it is not elegant and is not a solution for any "normal" app. I also want to keep the rotation animation. Just wondering if there is an event or function in the public API to use.