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.
<intent-filter>
<data android:name="android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION" />
</intent-filter>
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);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
getContext().startActivity(intent);
But I want to use this flag in Android Manifest. To disable animation also in case returning from second activity to first.
This is not an example use or an explanation of how to use
FLAG_ACTIVITY_NO_ANIMATION
, however it does answer how to disable theActivity
switching animation, as asked in the question title:Android, how to disable the 'wipe' effect when starting a new activity?
You can create a style,
and set it as theme for your activity in the manifest:
You can also define a style to specify custom entry and exit animations. http://developer.android.com/reference/android/R.attr.html#windowEnterAnimation
Try this code,
create your own style overriding android:Theme
Then use it in manifest like this:
Here is a one-liner solution that works for as low as
minSdkVersion 14
which you should insert in youres/styles.xml
:like so:
Cheers!
If your context is an activity you can call overridePendingTransition:
So, programmatically: