将“最近使用的应用程序”中的应用程序内容设为空白列表
当应用程序显示在最近使用的菜单中时,我需要将内容设为空白,以便无法截图。 该标志起作用
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
,屏幕变为空白色。我需要处理用户选择黑暗模式的场景,因此屏幕必须是空的黑暗。
除了使用此标志之外,我还有什么其他选择?
When the app is shown in the recents menu, I need to make the content blank, so that screenshots can not be taken.
This flag works
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
and the screen becomes empty white. I need to handle the scenario where the user has selected the dark mode, and so the screen must be empty dark.
What other options can I have other than using this flag?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
抱歉,您无法控制操作系统在概览屏幕中显示应用的方式(使用
FLAG_SECURE
时的颜色)。Sorry, but you do not have control over how the OS displays your app in the overview screen, in terms of the color when
FLAG_SECURE
is used.我在github上找到了这个库,可以解决这个问题。
https://github.com/nimblehq/recent-apps-thumbnail-hiding
您可以对最近的应用程序视图使用自定义布局。
I have found this library on github that solves the problem.
https://github.com/nimblehq/recent-apps-thumbnail-hiding
You can use custom layout for the recent app views.