How to make Android activity execute only once and return no longer leaving no trace of history

Sometimes when we develop an activity opened by Android, we only want him to appear once, jump to another activity, and then return to it. There is no need to appear in him, and it will not be used in the future. For example, the splash screen page is such a demand. To achieve it.
Add an attribute in the corresponding activity in AndroidManifest.xml

android:noHistory="true"

This means that when the activity is not visible, it is automatically closed, there is no stack, and the return will not appear.

Published 14 original articles · Like8 · Visit 70,000+

Guess you like

Origin blog.csdn.net/wm20000/article/details/105452432