简体   繁体   English

Android - 从Recent Apps中删除应用程序

[英]Android - Remove application from Recent Apps

I am developing an android application. 我正在开发一个Android应用程序。 If I close my application, my app available in the "Recent Apps" List. 如果我关闭我的应用程序,我的应用程序在“最近的应用程序”列表中可用。 Now I don't want to show it in "Recent Apps". 现在我不想在“最近的应用程序”中显示它。 How can I remove it from "Recent Apps List" after closing my application programmatically. 如何以编程方式关闭我的应用程序后,如何从“最近的应用程序列表”中删除它。 Please can you share your suggestions. 请你能分享一下你的建议。

In you Manifest.xml , set the following to your Root Activity Manifest.xml ,将以下内容设置为Root活动

<activity
    android:name=".Your_Root_Activity_Name"
    android:excludeFromRecents="true"
    .... 
</activity>

Depending on the results, you might also have to use the android:noHistory="true" attribute. 根据结果​​,您可能还必须使用android:noHistory="true"属性。 But not sure if it is required in your case. 但不确定在您的情况下是否需要它。

For more information about this: http://developer.android.com/guide/topics/manifest/activity-element.html 有关此内容的更多信息,请访问: http//developer.android.com/guide/topics/manifest/activity-element.html

Add excludeFromRecents="true" to your activity in AndroidManifest.xml: excludeFromRecents="true"添加到AndroidManifest.xml中的活动:

<activity android:name=".MainActivity"
          android:excludeFromRecents="true" ...

覆盖其他活动中的onResume方法,然后销毁它们并调用主Activity。

In your AndroidManifest.xml, use this for Activity: 在AndroidManifest.xml中,将其用于Activity:

<activity
    android:name="Your Activity"
    android:excludeFromRecents="true"
    android:noHistory="true"
    android:taskAffinity="">
</activity>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 终止应用程序并从最近的应用程序列表中删除[Android] - Kill application and remove from recent apps list [Android] 关闭应用程序并从最近的应用程序中删除/ - Close application and remove from recent apps/ 当按下返回键android时,从最近的应用程序中删除应用程序 - Remove app from recent apps when back key pressed android “最近使用的应用程序”或“概述屏幕”没有显示我的Android应用程序中的最新活动吗? - “Recent Apps” or “Overview screen” is not showing the recent activity on my application in Android? 以编程方式从最近的应用程序中删除应用程序 - Remove app from recent apps programmatically 如何从最近的应用程序列表中删除应用程序? - How to remove application from recent application list? 从“最近使用的应用程序”列表中删除应用程序后,Android服务将重新启动 - Android service gets restarted when application is removed from Recent Apps list 从Recent Apps Android 4.x隐藏/更改应用程序屏幕图片 - Hide/change the application screen picture from Recent Apps Android 4.x Android应用程序未出现在最近的应用程序列表中 - Android application doesn't appear on recent apps list 如何避免我的android应用程序显示在“最近的应用程序”列表中? - How to avoid my android application to be shown in the “recent apps” list?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM