question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically retry image requests after regaining network connectivity

See original GitHub issue

I am using the code below to load images from a URL into the target imageview When i try to load the images without internet connection,the error image is displayed,then if i turn on internet connection,unlike Glide, Coil doesn’t try to reload the images from the URL.

 fun loadImageWithCoil(
        target: ImageView,
        imgUrl: String?,
        placeHolder: Int = R.drawable.profile_pic_placeholder,
        errorImg:Int=R.drawable.ic_terrain_black_24dp
    ) {
        target.load(imgUrl) {
            placeholder(placeHolder)
            crossfade(true)
            error(errorImg)
        }

    }

Is this currently not possible or I’m not doing it right?.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mariocommented, Oct 14, 2019

I would assume “lots”. Network connectivity is different from being able to load something from network for various reasons.

0reactions
ouattararomualdcommented, Jun 29, 2021

Fresco has tap to reload (after a failure). Maybe coil can do the same ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retrying failed network requests automatically on Android
The complete example code “Retrying failed network requests automatically on Android” can be found in my AndroidBasicLib in sample. screens.  ...
Read more >
Retry Policy Recommendations - LivePerson Developer Center
This results in a vicious cycle where more and more requests are sent to the resource or service, and consequently its ability to...
Read more >
Error handling with DynamoDB - AWS Documentation
The AWS SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too...
Read more >
Error Handling with Combine and SwiftUI - Peter Friese
Device/network offline; Semantic validation errors; Response parsing errors / invalid URL; Internal server errors. Source Code. If you want to ...
Read more >
Task sequence variable reference - Configuration Manager
If the task sequence doesn't reference a boot image package, ... The name of the network connection as it appears in the network...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found