Take the 2-minute tour ×

How can I use properly the Intent flag FLAG_ACTIVITY_NO_ANIMATION in AndroidManifest file? I supose my problem is trivial, but I can't find good example or solution to it.

    <data android:name="android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION" />

However no error is reported by compliator, but data isn't correct. I just want to disable animation in case switching between activities. I can use getWindow().setWindowAnimations(0); in onCreate or onResume rather but using flag is better way, isn't it?

I can use also in code:

Intent intent = new Intent(v.getContext(), newactivity.class);

But I want to use this flag in Android Manifest. To disable animation also in case returning from second activity to first.

share|improve this question
I have found the sugestion to use theme - by defining enter, exit animations for activities or entire application. Can someone give me more informations about it? –  woyaru Aug 7 '11 at 11:59

4 Answers 4

up vote 86 down vote accepted

You can create a style,

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

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

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

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

share|improve this answer
Thanks, this works just great especially for transparent/dialog themed activities excluded from recents with a different task affinity. Without this the animation kept showing creating very odd results for a dialog being opened! –  3c71 Oct 5 '13 at 8:54

Try this code,

this.startActivity(new Intent(v.getContext(), newactivity.class).addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION));
share|improve this answer

If your context is an activity you can call overridePendingTransition:

this.startActivity(new Intent(v.getContext(), newactivity.class));
this.overridePendingTransition(0, 0);
share|improve this answer
Thanks for this –  prettyvoid Oct 31 at 21:09

This is not an example use or an explanation of how to use FLAG_ACTIVITY_NO_ANIMATION, however it does answer how to disable the Activity switching animation, as asked in the question title:

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

share|improve this answer

Your Answer


