Skip to content

Instantly share code, notes, and snippets.

@gtomek
Created December 20, 2021 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtomek/ca80908f80422829155741a3cacea3a7 to your computer and use it in GitHub Desktop.
Save gtomek/ca80908f80422829155741a3cacea3a7 to your computer and use it in GitHub Desktop.
enable strict mode, just flashing
private void enableStrictMode() {
StrictMode.ThreadPolicy.Builder threadPolicyBuilder = new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyFlashScreen()
.penaltyLog();
StrictMode.VmPolicy.Builder vmPolicyBuilder = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog();
StrictMode.setThreadPolicy(threadPolicyBuilder.build());
StrictMode.setVmPolicy(vmPolicyBuilder.build());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment