Skip to main content

Command Palette

Search for a command to run...

Disable Screenshot in App

Published
1 min readView as Markdown

Many a times we have seen App which detect and won't allow us to take screenshots. So as an App developer on Xamarin, it's quiet intriguing to know how to achieve that. Turns out, it's just a line of code that would allow us to achieve that.

this.Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);

Setting up the Flags for Window Manager does the job. Now just add this in a Blank Android App and test it out. You will see that it works just like that.

Happy Coding!

More from this blog

B

Build, Break, Learn (by Anubhav)

32 posts

Insights, lessons, and deep dives on AI, Cloud, Architecture, and Modern Engineering—shared from the perspective of a hands-on builder focused on clarity, practical guidance, and real-world impact.