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 load placeholder when loading empty or null URI

See original GitHub issue

Using the following code

imageView.load(url) {
    placeholder(R.drawable.image)
}

If the url is empty or null then it would be great if the placeholder is loaded automatically. It doesn’t seem to do that currently.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
colinrtwhitecommented, Jan 4, 2020

You can also use:

imageView.load(url) {
    fallback(R.drawable.image)
}

to set a fallback drawable if the url is null.

0reactions
alanleedevcommented, Jan 8, 2020

@mario @colinrtwhite Sorry for the late reply. I’ve found there were similar request and discussions in the past. fallback seems to be what I’ve been looking for so okay to close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set an image if Uri is empty - android - Stack Overflow
If imageUrl is there then it will show otherwise it will take placeHolder image. Glide.with(context) .load(imageUrl) .
Read more >
Picasso — How to Deal with Null/Empty Values (in ListViews)
In this blog post, we'll show you how to deal with null values, especially in ListViews, where the re-usage of views can lead...
Read more >
<input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >
Displaying Images with the Glide Library - CodePath Cliffnotes
It provides animated GIF support and handles image loading/caching. ... Glide.with(context) .load("http://via.placeholder.com/300.png") .into(ivImg);.
Read more >
Loading Image with Glide in Android - Section.io
In this tutorial, we will learn how to use the Glide library to load images either from the internet (URL) or from Drawable...
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