androidManifest activity android:excludeFromRecent

2019-02-18 06:00发布

I am using following code to open an activity as a popup window using

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

But excludeFromRecents is not working. If user clicks back button the popup window shows while retrieving back to main menu.

1条回答
家丑人穷心不美
2楼-- · 2019-02-18 06:38

Use 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.

查看更多
登录 后发表回答