Skip to content

Instantly share code, notes, and snippets.

@taworn
Last active September 22, 2018 11:09
Show Gist options
  • Save taworn/4863ea8147192c6cbd4f to your computer and use it in GitHub Desktop.
Save taworn/4863ea8147192c6cbd4f to your computer and use it in GitHub Desktop.
Where to put overridePendingTransition?
The method overridePendingTransition() should put after called startActivity[ForResult]() for enter. And then put after finish() to exit. If we put this in onCreate(), they may be a chance to mistake.
When start:
startActivityForResult(intent, ...);
overridePendingTransition(R.animator.anim_slide_left_to_right_enter, R.animator.anim_slide_left_to_right_leave);
When exit:
finish();
overridePendingTransition(R.animator.anim_slide_right_to_left_enter, R.animator.anim_slide_right_to_left_leave);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment