上海装修网站大全/做销售最挣钱的10个行业
因为Android9.0+默认是https请求。Glide在9.0系统上加载网络图片失败 只要把http换成https就可以了
这里的原因是代码里图片在服务器的地址是http
imgList.add("http://img1.imgtn.bdimg.com/it/u=1760283799,1689150510&fm=26&gp=0.jpg");imgList.add("http://img1.imgtn.bdimg.com/it/u=1806680339,1258257998&fm=26&gp=0.jpg");
解决办法:
新建一个包,这里起名为xml,新建了一个network_config.xml文件
<network-security-config><base-config cleartextTrafficPermitted="true" />
</network-security-config>
在AndroidManifest.xml文件里的 application 引入network_config文件
<applicationandroid:networkSecurityConfig="@xml/network_config"</application>