[英]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.