Search code examples
androidscreenshotlayoutparams

Disable screen capture functionality


I know that we can suppress screen capture functionality using the code

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

But, In my case I have a library, and on a button click I call a method from Library and that method launches new activity. Now, I want to disable screen capture on the newly launched activity, but I cant add this line on newly launched activity since it is launched through library. How can I do that ?


Solution

  • Resolved. In my case library provides an API through which I can have access to launched activity, so I added the essential line into onCreate() of it. Thanks :)