You Cannot Start a Load for a Destroyed Activity in Relativelayout Image Using Glide

You cannot start a load for a destroyed activity in relativelayout image using glide

Use:

Glide.with(getApplicationContext()).load(...)

Instead of:

Glide.with(TabMorePagesDetailActivity.this).load(...)

Hope it will solve your problem~

BEWARE: See Glide image loading with application context if you decide to use applicationContext

Error of Glide library: You cannot start a load from a destroyed Activity

Check whether your activity is finishing before using Glide. Something like this:

if (!activity.isFinishing()) {
Glide.with(...
}

Glide cannot load image

Unfortunately, all answers were right, but they did not work in my condition. Server settings were not suitable for downloading pictures from it.

==UPDATE==

After a while, I figured out that the pictures on my server were broken. You can check if your picture at provided URL is valid by opening this URL in Mozilla Firefox.
The last few kilobytes in pictures may be deleted, but browsers like Google Chrome ignores that and shows image normally. However, Firefox is more sensitive, so it helps to localize the problem.

==UPDATE2==

After another while, I figured out that not only broken pictures can cause the problem. Try add android:usesCleartextTraffic="true" in Manifest in application. It will solve some issues with picture loading.



Related Topics



Leave a reply



Submit