android - 别人的activity按返回键退出后 再次打开后 就不显示开场动画 但是我的按退出后直接destroy,依然显示开场动画
PHP中文网
PHP中文网 2017-04-17 17:46:26
0
3
541

别人的activity按返回键退出后 再次打开后 就不显示开场动画 但是我的按退出后直接destroy,依然显示开场动画

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
洪涛

Yours is a normal phenomenon of starting a new Activity every time, because it is destroyed every time you go back. As for you saying that there is no startup animation for other people’s second login (is it the startup animation of the Activity or is it customized? An animation?), the current guess is that the startup mode uses singleInstanse, and then it is not destroyed when the return button is clicked, but moveTaskToBack, and then the existing Activity is opened when it is started again. At this time, the life cycle only goes onResume, as described It’s too vague, I’ll give you a rough guess

大家讲道理

Check whether the return key event calls finish() or System.exit(0);
If finish() is called, then when you click the app's desktop icon again, it will restart. process, the opening animation will be displayed again

左手右手慢动作

Call moveTaskToBack(true) when onBackPressed, which is equivalent to pressing the Home button without closing the Activity

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template