本文介绍了通过 xml 指定 LayoutParams.flag_secure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序的某些屏幕不允许截取屏幕截图.

I am working on an app which has certain screens which should not allow screenshots to be taken.

我已经能够通过代码成功做到这一点.

I have been able to do it successfully via code.

我一直试图找到一种方法来通过 xml 为我的活动指定 LayoutParams.FLAG_SECURE.但没有运气

I have been trying to find out a way to specify LayoutParams.FLAG_SECURE for my activity via xml.But no luck

AndroidManifest.xml 的活动标签中是否有等效的 xml 属性来支持这种机制.

So are there equivalent xml attributes to support this mechanism in activity tag of AndroidManifest.xml.

谢谢.

推荐答案

我认为这不可能.而且,当你通过代码指定时,你必须在onCreate中并且在调用super.onCreate之前进行.

I don't think its possible. Moreover, when you specify by code, you must do it in onCreate and before calling super.onCreate.

这篇关于通过 xml 指定 LayoutParams.flag_secure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 15:32