Difference between setWindowAnimations and overridePendingTransition?

What's the difference between

getWindow().setWindowAnimations()

      

and

Activity.overridePendingTransition()

      

Both seem to have the same functionality.

+3


source to share


1 answer


When we use

getWindow().setWindowAnimations(R.anim.start);

      

then this animation works when the window is opened, but in this type of method we cannot add the animation of closing the window.

But using



Activity.overridePendingTransition(R.anim.start,R.anim.end); 

      

this We can show the animation when the window is closed The first parameter of this method is to start the animation AND the second parameter of this method ends with animatin.

So the difference between the above methods overridePendingTransition () is used to set the start and end of the animation to the activity. setWindowAnimations is used to set only the initial animation.

+7


source







All Articles