How can I add an animation to the activity finish()

后端 未结 8 1856
清酒与你
清酒与你 2020-11-27 13:37

I\'m using overridePendingTransition for when my activity is created and that works fine I can see the fade in works great, but when I try and animate the finish on the acti

8条回答
  •  一个人的身影
    2020-11-27 14:26

    This question has already answered but the most efficient way to put an animation while exiting from an activity is by overriding the "finish()" method of the related activity:

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.hold, R.anim.slide_out_bottom);
    }
    

提交回复
热议问题