In close() at SocketHttpClientConnection in Android

In close() at SocketHttpClientConnection Error In Android.


when i tried to acess network data on MainThread above Android 3.0 >= . I am unable to access . I am getting error In close() at SocketHttpClientConnection. Then i enabled strict mode issue solved.

Add this code in onCreate method.

StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);

 

原文地址:https://www.cnblogs.com/yangzhang/p/3431344.html