androidManifest Activity android :excludeFromRecents

标签 android android-activity android-manifest

我正在使用以下代码将 Activity 作为弹出窗口打开

<activity android:name=".RadioButtonExample" 
            android:theme="@android:style/Theme.Dialog"
            android:excludeFromRecents="true"/>

但是 excludeFromRecents 不起作用。如果用户点击后退按钮,弹出窗口会在返回主菜单时显示。

最佳答案

使用android:noHistory="true"

Whether or not the activity should be removed from the activity stack and finished (its finish() method called) when the user navigates away from it and it's no longer visible on screen — "true" if it should be finished, and "false" if not. The default value is "false". A value of "true" means that the activity will not leave a historical trace. It will not remain in the activity stack for the task, so the user will not be able to return to it.

关于androidManifest Activity android :excludeFromRecents,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8037869/

相关文章:

安卓数据库。提供数据或代码?

android - Cordova 3.1 方向不工作

java - 在android中检测带有广告的 Activity

android - Activity 无法解析或不是字段

Android:是否可以在 AndroidManifest.xml 文件中读取包名

android - 混淆 Android Activity 名称

java - 如何去 listview 适配器项目单击监听器到 android 中的 fragment ?

android - 为 x86 编译的 APK 可以上传到 Amazon Appstore 吗?

android - OpenCV,安卓 : Detecting an object from an image instead of real-time detection

android - 与安卓服务通信