gpt4 book ai didi

android - 在 Android Kotlin 中更改默认 FLAG_SECURE toast 消息

转载 作者:行者123 更新时间:2023-12-02 13:18:37 25 4
gpt4 key购买 nike

我在我的 android 应用程序中使用了以下代码,以防止用户截取屏幕截图或屏幕录制:

if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
}

它显示以下 toast 消息:“无法捕获屏幕,受 DRM 保护的图像。”

如何更改此 toast 消息?我试图在 Stack Overflow 的答案中搜索,但没有任何帮助,或者如果它不可更改,当检测到屏幕记录或捕获时如何显示另一条 toast 消息?

最佳答案

how to change this toast message?



你不能。该消息来自操作系统,而不是您的应用程序。这样的消息是否存在,以及它的外观和包含的内容,将取决于操作系统版本和设备制造商的修改。

how to show another toast message with it when a screen record or capture is detected?



你不能,因为你的应用没有检测到这些事件。操作系统是。

关于android - 在 Android Kotlin 中更改默认 FLAG_SECURE toast 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61312696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com