Disable Activity Slide-In Animation When Launching New Activity

How to switch activity without animation in Android?

You can create a style,

 <style name="noAnimTheme" parent="android:Theme">
<item name="android:windowAnimationStyle">@null</item>
</style>

and set it as theme for your activity in the manifest:

   <activity android:name=".ui.ArticlesActivity" android:theme="@style/noAnimTheme">
</activity>

You can also define a style to specify custom entry and exit animations.
http://developer.android.com/reference/android/R.attr.html#windowEnterAnimation

Disable Transition Animation Between Activities

if you want to do it for all activities then do it in this way:

switching activities without animation

Just assign style with no animation to each activity in manifest.

Or through code do it in this way:

Disable activity slide-in animation when launching new activity?

Android, how to disable the 'wipe' effect when starting a new activity?

CaseyB response is good we can set an animation

getWindow().setWindowAnimations(int);

but since Android SDK 2.0 you will use overridePendingTransition(), to change the transition animation, this is an example loading my App from the SplashScreen.

      @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.SplashScreen);

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent mainIntent = new Intent(SplashScreen.this, AndroidNews.class);
SplashScreen.this.startActivity(mainIntent);
SplashScreen.this.finish();

overridePendingTransition(R.anim.mainfadein,
R.anim.splashfadeout);
}
}, 3000);
}

}

Disable activity slide transition change in android?

Well! this is not possible. It can be possible with API level 5 using overridePendingTransition (0,0);
and using addFlags(65536); in lower levels also but with startActivity();



Related Topics



Leave a reply



Submit