Skip to content

Instantly share code, notes, and snippets.

@BartoszJarocki
Created May 13, 2017
Embed
What would you like to do?
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