Tuesday, December 13, 2011

Animation between one activity to another activity in android

Animation between one activity to another activity in android.
Animation between Activity A to Activity B.
anim/mainfadein.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
            android:interpolator="@android:anim/accelerate_interpolator"
            android:fromAlpha="0.0"
            android:toAlpha="1.0"
            android:duration="1000" />
anim/splashfadeout.xml
<?xml version="1.0" encoding="utf-8"?>
    <alpha xmlns:android="http://schemas.android.com/apk/res/android"
            android:interpolator="@android:anim/decelerate_interpolator"
            android:zAdjustment="top"
            android:fromAlpha="1.0"
            android:toAlpha="0.0"
            android:duration="1000" />
just u have to this code in onCreate();
overridePendingTransition(R.anim.mainfadein, R.anim.splashfadeout);                                
                             or
calling another activity.
Intent in=new Intent(this,ActivityB.class);
startActivity();
overridePendingTransition(R.anim.mainfadein, R.anim.splashfadeout);


1 comment:

Check out this may be help you

Related Posts Plugin for WordPress, Blogger...