0

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.

Eduardo Pinheiro
  • 3,409
  • 3
  • 30
  • 39
  • I don't know how that works but I believe that if there's a Transition, the class `TransitionManager` (https://developer.android.com/reference/android/transition/TransitionManager.html) should have a `Transition` set. That being said, I haven't found a way to get it from that class – Shinra tensei Sep 05 '17 at 09:26
  • You have this method getWindow().getTransitionManager() to get the transition manager but you cannot get this kind of info. – Eduardo Pinheiro Sep 05 '17 at 09:35
  • My question now is, is it really necessary for you to know if there's a transition? Can't you do what you want to do without knowing so? Could you do it anyways if you chose the transitions instead? – Shinra tensei Sep 05 '17 at 09:41

0 Answers0