Skip to content

Instantly share code, notes, and snippets.

@BartoszJarocki
Created May 13, 2017 15:42
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 BartoszJarocki/2210b1c5a3a3b087a9874701faf9a065 to your computer and use it in GitHub Desktop.
Save BartoszJarocki/2210b1c5a3a3b087a9874701faf9a065 to your computer and use it in GitHub Desktop.
private void enableStrictMode() {
if (BuildConfig.DEBUG) {
StrictMode.VmPolicy vmPolicy = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDeath()
.build();
StrictMode.setVmPolicy(vmPolicy);
StrictMode.ThreadPolicy threadPolicy =
new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build();
StrictMode.setThreadPolicy(threadPolicy);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment