产生错误的代码:
@Override
protected void onCreate(Bundle savedInstanceState)
{
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
super.onCreate(savedInstanceState);
setContentView(R.layout.pub_login);
findViews();
setListeners();
getLoginParam();
checkUpdate();
}
正常的代码:
@Override
protected void onCreate(Bundle savedInstanceState)
{
//StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());
//StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
super.onCreate(savedInstanceState);
setContentView(R.layout.pub_login);
findViews();
setListeners();
getLoginParam();
checkUpdate();
}