下面的代码片段是为线程策略设置 StrictMode。本规范将在我们申请的入口点设置

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()  
    .detectDiskWrites()  
    .penaltyLog() //Logs a message to LogCat  
    .build())