版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wdx_1136346879/article/details/85317210
9.0系统接口访问网络需要https
在values下新建xml文件:network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
然后再application中加入黑色字体这两句话即可
<application
android:networkSecurityConfig="@xml/network_security_config" tools:targetApi="n" android:name=".nihao" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning" >