Finish old activity and start a new one or vice versa

后端 未结 7 2165
轮回少年
轮回少年 2020-12-02 15:16

I know, that I get the same result with both code snippets

finish();
startActivity(newActivity);

and

startActivity(newActiv         


        
7条回答
  •  忘掉有多难
    2020-12-02 15:32

    The animation is clearly different (at least on 4.1 onwards). Calling finish() first starts to fade away the first activity earlier and you can briefly see a black background before the new activity fades in. Calling startActivity() first fades in the new activity on top of the old one and the black background is not visible.

提交回复
热议问题