url = new URL(urlStr);
urlConn = (HttpURLConnection) url.openConnection();
// 设置请求方式为"GET"
urlConn.setRequestMethod("GET");
// 超时响应时间为5秒
urlConn.setConnectTimeout(5 * 1000);
inputStream = urlConn.getInputStream();
getInputStream()无法执行,无异常,无报错;
解决方法在Manifest.XML文件中只要把targetSdkVersion去掉,问题就能解决了: