Created
February 19, 2016 03:18
-
-
Save svareniem/6fbcc0ffcf7968ee122a to your computer and use it in GitHub Desktop.
Enable Strict Mode in Application onCreate()
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
protected void enableStrictMode() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectAll() | |
.penaltyLog() | |
.penaltyDeath() | |
.build()); | |
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() | |
.detectAll() | |
.penaltyLog() | |
.penaltyDeath() | |
.build()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment