将“最近使用的应用程序”中的应用程序内容设为空白列表

发布于 2025-01-09 10:23:02 字数 212 浏览 0 评论 0原文

当应用程序显示在最近使用的菜单中时,我需要将内容设为空白,以便无法截图。 该标志起作用

 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

明明#如月 2025-01-16 10:23:02

抱歉,您无法控制操作系统在概览屏幕中显示应用的方式(使用 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.

一城柳絮吹成雪 2025-01-16 10:23:02

我在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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文