Created
November 18, 2018 15:19
-
-
Save pedromassango/7145a89191953eca039df5c394eafe80 to your computer and use it in GitHub Desktop.
Como inicializar StrictMode no android
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
public void onCreate() { | |
super.onCreate(); | |
if (DEVELOPER_MODE) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectNetwork() // ou .detectAll() | |
.penaltyLog() | |
.build()); | |
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() | |
.detectLeakedSqlLiteObjects() | |
.detectLeakedClosableObjects() | |
.penaltyLog() | |
.penaltyDeath() | |
.build()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment