So I know you can use your own animation between activities using the overidePendingTransition method. I set up a transition between two activites and it works perfect on my emulator but I see no transition when I flash the app on to my phone. How can this be?
My emulator is running 2.2 as is my phone
Here is my onCreate method
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button = (Button) findViewById(R.id.close);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent myIntent = new Intent(ActivityTransitionActivity.this, ActivityTwo.class);
ActivityTransitionActivity.this.startActivity(myIntent);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
}
});
}
Translate Animation can change the visual appearance of an object, but they cannot change the objects themselves. That is, if you apply a translate animation to a view, it would move to a new position, but its click events would not get fired; the click events would still get fired at its previous position.
<style name="Animation.CustomAnimation">
<item name="android:activityOpenEnterAnimation">@anim/slide_in_left</item> When opening a new activity, this is the animation that is run on the next activity
<item name="android:activityOpenExitAnimation">@anim/slide_out_right</item>When opening a new activity, this is the animation that is run on the previous activity (which is exiting the screen)
<item name="android:activityCloseEnterAnimation">@anim/slide_in_right</item>When closing the current activity, this is the animation that is run on the next activity (which is entering the screen).
<item name="android:activityCloseExitAnimation">@anim/slide_out_left</item>When closing the current activity, this is the animation that is run on the current activity (which is exiting the screen).
</style>
<style parent="android:style/Theme.Light.NoTitleBar.Fullscreen" name="app_theme">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowAnimationStyle">@style/Animation.CustomAnimation</item>
</style>
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@style/app_theme">
apply app_theme to your application in android manifest
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