Home > Mobile >  How to prevent Screenshots & Screen Recording in a flutter desktop application
How to prevent Screenshots & Screen Recording in a flutter desktop application

Time:08-22

I want to prevent user from taking screenshots and screenrecording

CodePudding user response:

There are almost unlimited alternatives to record a desktop screen, I doubt that you will find any effective solution to prevent desktop users recording your application.

CodePudding user response:

Android

  1. Locate your MainActivity (.java or .kt) class inside the embedded android project dir in your Flutter Project.

  2. Add the following import to your main activity class:

    import android.view.WindowManager.LayoutParams;

  3. Add the following line to your MainActivity's onCreate method:

getWindow().addFlags(LayoutParams.FLAG_SECURE);

  • Related