Android开发中各个版本的问题总结

Android9.0

网络问题

问题原因: Android P 限制了明文流量的网络请求,非加密的流量请求都会被系 统禁止掉(HTTP),建议使用HTTPS。

解决方案:在资源文件新建xml目录,新建文件,文件名
network_security_config.xml



 

打开AndroidManifest.xml文件,在application标签中加入
android:networkSecurityConfig="@xml/network_security_config"


 

https://zhuanlan.zhihu.com/p/52619909

你可能感兴趣的:(Android)