Created
March 23, 2019 18:29
-
-
Save kirich1409/f679e422a240ed1938b1c53abfebda5e to your computer and use it in GitHub Desktop.
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
StrictMode.ThreadPolicy.Builder threadPolicyBuilder = | |
new StrictMode.ThreadPolicy.Builder() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectDiskReads() | |
.penaltyLog(); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
threadPolicyBuilder.detectResourceMismatches(); | |
} | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | |
threadPolicyBuilder.detectUnbufferedIo(); | |
} | |
StrictMode.setThreadPolicy(threadPolicyBuilder.build()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment