bumptech / bumptech/glide

error(R.drawable.xxxx) and placeholder(R.drawable.xxxx) do not work in glide

Open
#5,404 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.11.0

**Integration libraries**:

**Device/Android Version**: any devices

**Issue details / Repro steps / Use case background**:
I am using Glide in dfm and save the image in the drawble folder so that an error image is displayed when the image load fails as shown below.
```
Glide.with(binding.root.context)
.load("url")
.error(R.drawable.xxxxx)
.into(binding.icon)
```

If the resource id value of R.drawable.xxxxx is a negative integer, it will not operate. If it is a positive integer, it will operate normally.

```
public T error(@DrawableRes int resourceId)
```
Are you separately checking the validity of the errorId value saved in the above function?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.