0

After I have researched most of the answer to prevent screen record is

import com.reactnativenavigation.controllers.SplashActivity;
import android.os.Bundle;
import android.view.WindowManager;

public class MainActivity extends SplashActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
    }
}

but this does not actually work for me and don't really get into develop android app.

  • https://stackoverflow.com/a/31406316/5908974 – MattyK14 Jun 22 '18 at 20:02
  • 1
    I have done on newly create project followed the link but I got an error F:\ReactNative\testVideoCapture\android\app\src\main\java\com\testvideocapture\MainApplication.java:46: error: cannot find symbol getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); ^ symbol: method getWindow() location: class MainApplication 1 error :app:compileDebugJavaWithJavac FAILED do you have any working example on react native? – Karnphong Kieoprasert Jun 23 '18 at 05:41
  • [link](https://github.com/hawkup/react-native-prevent-screenshot) here is working example tested on android – Karnphong Kieoprasert Jul 16 '18 at 15:19

0 Answers0