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!
Latest posts by Anubhav Ranjan (see all)
- Building a Simple Semantic Kernel Agent in C# - August 2, 2025
- Introduction to Autogen - July 12, 2025
- From Insomnia to Innovation: Building SleepScape - June 18, 2025
Can you have any idea how to restrict ios Screenshot in above ios 7