Android - How to stop animation between activity changes

前端 未结 5 2259
轮回少年
轮回少年 2020-12-15 17:28

I have multiple different Activity in my app and I don\'t want any transition animation when changing between Activities. Below is the how I\'m changing between Activities:

5条回答
  •  盖世英雄少女心
    2020-12-15 18:04

    I wa needing this as I had to create activities on clicking the menus.

    I did the following :

    I added the FLAG_ACTIVITY_NO_ANIMATION flag to the intent. It stopped the animations while creating the activity for the first time.

    However the activities in the stack which were called when we click on the same menu again (probably from a different activity), it had the animation.

    So I added FLAG_ACTIVITY_NO_HISTORY to clear or rather finish the activity when it starts a new activity. This caused to create a new activity (without animation) when I click on the menu once again.

提交回复
热议问题