更改Android Kotlin中的默认FLAG_SECURE吐司消息 [英] changing default FLAG_SECURE toast message in Android Kotlin
问题描述
我在Android应用中使用了以下代码,以防止用户拍摄屏幕截图或屏幕录像:
I have used the following code in my android app, to prevent the user from taking screenshots, or screen recording:
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
}
它显示以下吐司消息:无法捕获屏幕,DRM保护的图像."
it shows the following toast message: "Unable to capture screen, DRM protected image."
如何更改此吐司信息?我尝试在Stack Overflow答案中搜索此处,但无济于事,或者如果它不可更改,当检测到屏幕记录或捕获时如何显示另一条Toast消息?
how to change this toast message? i tried to search here in Stack Overflow answers but nothing helped, or if it's unchangeable, how to show another toast message with it when a screen record or capture is detected?
推荐答案
如何更改此吐司消息?
how to change this toast message?
不能.该消息来自操作系统,而不是您的应用程序.这样的消息是否存在以及它的外观和包含的内容将取决于操作系统版本和设备制造商的修改.
You can't. That message is coming from the OS, not your app. Whether such a message exists, and what it looks like and contains, will depend on the OS version and deivce manufacturer modifications.
当检测到屏幕记录或捕获时,如何与它一起显示另一个吐司消息?
how to show another toast message with it when a screen record or capture is detected?
您不能这样做,因为您的应用程序未检测到这些事件.操作系统是
You can't, as your app is not detecting these events. The OS is.
这篇关于更改Android Kotlin中的默认FLAG_SECURE吐司消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!