简体   繁体   English

如何禁用Android应用程序的屏幕截图?

[英]How do I disable screenshot from an android application?

How do I disable screenshot when my app is running on an android device? 当我的应用程序在Android设备上运行时,如何禁用屏幕截图? Is there any way to prevent someone from taking a screenshot? 有什么方法可以防止有人截屏吗?

使用Flag Secure作为布局参数标志。

In the onCreate() method , add the flag onCreate() 方法中 ,添加标志

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);

before setContentView(); setContentView();之前setContentView();

Really simple, had the same problem when playing games. 非常简单,在玩游戏时遇到同样的问题。 Go to SETTINGS and look under either DEVICES or ADVANCED FEATURES. 转到“设置”并查看“设备”或“高级功能”。 From there you should see SMART CAPTURE and PALM SWIPE CAPTURE. 从那里你应该看到SMART CAPTURE和PALM SWIPE CAPTURE。 Disable them... problem solved. 禁用它们......问题解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM