if(BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectAll() // or .detectAll() for all detectable problems
.penaltyLog()//写LOG到logcat,可搜索StrictMode
.penaltyDialog()//弹出对话框提示
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.penaltyLog()
.penaltyDeath()//杀死程序
.build());
}