Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. /**
  2. * Using {@link android.view.Window#setWindowAnimations(int)} did not work for versions newer
  3. * than {@link android.os.Build.VERSION_CODES#M} so faking recreate to achieve fade animation.
  4. * Not setting through theme because don't want to fade in or out if Night Mode did not change.
  5. */
  6. @Override
  7. public void recreate() {
  8. finish();
  9. overridePendingTransition(R.anim.anime_fade_in,
  10. R.anim.anime_fade_out);
  11. startActivity(getIntent());
  12. overridePendingTransition(R.anim.anime_fade_in,
  13. R.anim.anime_fade_out);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement