Android 4.0之后不能在主线程中做网络请求
我找了很多方法,才解决
Android之NetworkOnMainThreadException异常
是指不能在主线程中做网络请求
代码如下:
new Thread(new Runnable() {
Bitmap bitmap = null;
@Override
public void run() {
URL url = null;
try {
url = new URL("http://test.zuihou99.com" + urls);
InputStream is = null;
BufferedInputStream bis = nu