Created
December 20, 2021 07:24
-
-
Save gtomek/ca80908f80422829155741a3cacea3a7 to your computer and use it in GitHub Desktop.
enable strict mode, just flashing
This file contains hidden or 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
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