switch between activity with rotation animation


does anybody knows how to launch a new activity with rotation animation?

I'll try to explain what i want to do:

For instance i've looked for android app exemple in skd sample "apidemos" and i've found a class named com.exemple.android.apis.animation.Rotate3dAnimation.java and com.exemple.android.apis.animation.Transition3d.java. These classes allow me to switch between image with rotation effect.

That I would like to know if there is a way to do the same but instead of image, i will be activity (whith new layout).


This is how we can accomplish this. Suppose we want to switch from Activity A to B. First we will animate activity A then we will start activity B in overridden function "onAnimationFinished". This will ensure that activity B is started only after animation for activity A has finished off.

// we will only animate activity A here.
// The activity B will be animated from its onResume() - be sure to implement it.

final Intent intent = new Intent(getApplicationContext(), B.class);
// disable default animation for new intent
//Animate A
ActivitySwitcher.animationOut(findViewById(R.id.A), getWindowManager(), new ActivitySwitcher.AnimationFinishedListener() {
        public void onAnimationFinished() {
            // Start activity B

Now override "onResume" function for activity B

protected void onResume() {
// animateIn this activity
ActivitySwitcher.animationIn(findViewById(R.id.help_top), getWindowManager());

You can see here for working example


The window manager doesn't support 3d transformations at this point; since each activity is a window, animations between activities are window animations, so they are limited to what the window manager supports.

By : hackbod

This video can help you solving your question :)
By: admin