I'm making a notes app and I'm trying to use overridePendingTransition(); to add transition between activities and I'm running into an issue. The effect I'm going for is when I add a new note the new activity comes in from the bottom which I have working. Now when I try to go back to my other activity I want the note to exit to the bottom, which it does but the activity switches and when it exits the activity behind is still the same activity until it's off screen then it switches. I'm going to include a link to show what I mean since this sounds very confusing. Any help would be greatly appreciated. Thanks everyone :)
this is the anim xml im using
trans_infrom_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<translate
android:fromYDelta="100%"
android:toYDelta="0%"
android:duration="275"/>
trans_outto_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<translate
android:fromYDelta="0%"
android:toYDelta="100%"
android:duration="275"/>
trans_notrans.xml
<?xml version="1.0" encoding="utf-8"?>
<translate
android:fromYDelta="0%"
android:toYDelta="0%"
android:duration="275"/>
MainActivity.java
public void Add_New_Note(View view) {
Intent new_note = new Intent(this, New_Note.class);
startActivity(new_note);
overridePendingTransition(R.anim.trans_infrom_bottom, R.anim.trans_notrans);
}
New_Note.java
public void back_to_sheets(View view) {
Intent back_to_sheets = new Intent(this, MainActivity.class);
startActivity(back_to_sheets);
overridePendingTransition(R.anim.trans_outto_bottom, R.anim.trans_notrans);
}