1、Android 9.0 从网络获取数据时会出现个弹窗错误 错误如图

出现这种问题很好解决
1、新建 res/xml/network_security_config.xml 文件 如图(2)

2、network_security_config.xml文件中
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
如图(3)

3、在AndroidManifest.xml 文件中 引用 network_security_config.xml文件 如图(4)

网友评论