How do I disable screenshot when my app is running on an android device? Is there any way to prevent someone from taking a screenshot?
使用Flag Secure作为布局参数标志。
In the onCreate()
method , add the flag
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
before 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. Disable them... problem solved.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.