会报这个 错误
10-23 22:52:26.218: E/AndroidRuntime(7298): at com.example.test_help.post.Cust_post.first(Cust_post.java:36)
10-23 22:52:26.218: E/AndroidRuntime(7298): at com.example.test_help.activity.Login_activity$2.onClick(Login_activity.java:74)
下面是自己写的
httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
HttpResponse httpResp = new DefaultHttpClient().execute(httpPost);
按照百度的神奇方法 在 onCreate方法里面
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.penaltyLog()
.penaltyDeath()
.build());
据说包治网络异常
我查了下 意识是严苛模式的线程策略和虚拟机策略
谁能简单说下 这个玩意为什么在这里能起作用?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
闭关修行中......