Can I change the Android startActivity() transition animation?

后端 未结 10 1671
臣服心动
臣服心动 2020-11-28 19:53

I am starting an activity and would rather have a alpha fade-in for startActivity(), and a fade-out for the finish(). How can I go about this in th

10条回答
  •  情深已故
    2020-11-28 20:33

    Most of the answers are pretty correct, but some of them are deprecated such as when using R.anim.hold and some of them are just elaboratig the process.

    So, you can use:

    startActivity(intent);
    overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
    

提交回复
热议问题