Android P (api28) does not support the http protocol solution

res / xml, build a network_security_config.xml file names can be arbitrary.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>

Configure AndroidManifest.xml:

 <application
        android:networkSecurityConfig="@xml/network_security_config"
		...
		>
    </application>
Published 400 original articles · won praise 364 · Views 1.62 million +

Guess you like

Origin blog.csdn.net/jjwwmlp456/article/details/89743388