Created
July 7, 2019 19:29
-
-
Save arahmanali/66a22f83cfa0a0157024450cc6eddd91 to your computer and use it in GitHub Desktop.
React Native Prevent Screenshot In Android - Update MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.stopscreenshotapp; | |
import com.facebook.react.ReactActivity; | |
import android.os.Bundle; | |
import android.view.WindowManager; | |
public class MainActivity extends ReactActivity { | |
/** | |
* Returns the name of the main component registered from JavaScript. | |
* This is used to schedule rendering of the component. | |
*/ | |
@Override | |
protected String getMainComponentName() { | |
return "stopScreenshotApp"; | |
} | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment