I'm re-opening this question because the accepted answer is not really a solution. As per one of the comments says, the transition can start even after the onStart. For what I've tested, it also can start after onResume or even after the onWindowFocusChanged event. Which means that we can't use a flag, at least on these methods, to control the problem.
When you use a transition between activities, you may want to run a certain transition animation and only run a piece of code in the end of that transition (like showing some views).
The problem, is when for some reason (like the user changes the current app or received a phone call or go to standby mode), when the user comebacks to the activity it comes without transition, which means that, in this case, you're will be waiting forever for the trigger of onTransitionEnd implying that the user, in this example, will not be faced by those views that you want to show.
Does anyone have a flawless solution for this problem?
Thanks in advance.