Home > Enterprise >  Image from http url not show in glide
Image from http url not show in glide

Time:01-24

I have a problem with glide, when i load image from http it's not working, but if image is from https it work fine:

Glide.with(context).load("http://imageurl").into(holder.foto);

CodePudding user response:

By default, Android does not allow network connections to non-HTTPS (HTTP) URLs, and will block them. One way to fix this issue is to add the following line of code in your app's AndroidManifest.xml file inside the application tag

<application 
android:usesCleartextTraffic="true">
...
</application>

Note: The use of android:usesCleartextTraffic="true" in your AndroidManifest.xml file may cause issues with Google's app store review process and could potentially result in your app being rejected.

CodePudding user response:

For security reason, Android doesn't allow some of URL's. Think to add android:usesCleartextTraffic="true" in your manifest file.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>

<uses-permission android:name="android.permission.INTERNET"/>

<application
    ...
    android:usesCleartextTraffic="true"
    ...>

    <activity>
    ...
    </activity>
</application>
  • Related