Android excludeFromRecents will not display the activity in the list of recently used applications

excludeFromRecentsIs an attribute in the Android application manifest file (AndroidManifest.xml), which is used to control whether the application is displayed in the list of recently used applications. An application can be excluded from the list of recently used applications by setting excludeFromRecentsthe property to .true

Here's an example of excluding an app from the recent apps list:

<activity
    android:name=".MainActivity"
    android:excludeFromRecents="true">
    <!-- 其他属性 -->
</activity>

In the example above, excludeFromRecentsthe property is set to true, which will make MainActivity invisible in the recent apps list. Please note that this just excludes the application from the list of recently used applications and does not affect the normal startup and operation of the application.

Use this attribute to provide a better user experience for certain types of applications (such as lock screen applications, instant messaging applications, etc.), or to hide the existence of the application under certain circumstances.

Guess you like

Origin blog.csdn.net/lzq520210/article/details/131674487