setContentView(R.layout.activity_main)下面加上如下代码
1
2
3
4
|
if
(android.os.Build.VERSION.SDK_INT > 9 ) {
StrictMode.ThreadPolicy policy =
new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
} |
原文地址:http://blog.csdn.net/u014600432/article/details/41680819