I am aware that from API level 5 it is possible to specify a flag in the intent to prevent the normal animation being applied when I start a new activity:
myIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
However, my question is: is there a way to achieve the same thing in an app supporting android 1.6?
You can do this with Activity. overridePendingTransition() . You can define simple transition animations in an XML resource file. You can do this in your Activity's onCreate function.
Android's transition framework allows you to animate all kinds of motion in your UI by simply providing the starting layout and the ending layout.
On the newer versions, you want to override the transition with 0,0 shortly after you start the activity:
Intent i = new Intent(this, YourNewActivity.class);
startActivity(i);
overridePendingTransition(0,0);
I tried this on 2.1 and 4.0.3, it worked for me. =)
I found it in the docs here
Use this: getWindow().setWindowAnimations(0);
within the Activity
that is starting.
This solution worked for me (Android 2.2):
Intent intent = new Intent(getContext(), YourClass.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
getContext().startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With