google / google/volley

NetworkImageView does not handle cancellation properly in all cases

Open
#383 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.4k
Forks
751
Avg merge
8h 49m
Merged PRs (30d)
2

Description

If an old image request is ongoing and a new one happens, the cancellation does not happen properly in this case:

1. The old image was already loaded before the new request happens, but the callback is delayed in the onResponse handler due to: "if (isImmediate && isInLayoutPass)"

2. The new image is loaded instantly (from a cache), but "if (isImmediate && isInLayoutPass)" does not happen for this request

Now the setImageBitmap() method is called first with the new image, then called again right afterwards with the old image.

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.