-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glide 4.1.1: crash when attempting to preload images without a locked GlideRequest #2379
Comments
Can you show the full implementation of your |
|
I just have the same a few hour ago. Please help me |
@sheamartinson if item == null, then you return the full request, which doesn't have a model set on it. If you filter out null items in your |
@jackvt93 Can you show your code just like @sheamartinson did above? |
@sjudd it does work if I filter out null items! In my implementation it's a little unpredictable knowing what will be sent to the preloader because the RecyclerView is a mix of text-only headers and thumbnails. Calling .load(null) fixes the crash though. |
Great thanks. I've tried to make the code a little more lenient here as well, probably good enough to start with. |
Glide Version: 4.1.1
Integration libraries:
Device/Android Version: Nexus 6P 7.1.1
Issue details / Repro steps / Use case background:
I am using the recyclerview integration library to preload images in a recyclerview that is displaying thousands of photos in a gridview.
The preloader is initialized like so:
The crash happens when the recycler view is scrubbed. ie, when a scrubber is grabbed and rapidly moved around. I haven't been able to reproduce the error with regular scrolling. I have played around with the adapter that is implementing the PreloadModelProvider.
case 1: this request works and has not crashed
the locked requests:
the request from getPreloadRequestBuilder:
fullRequest.load(o).thumbnail(thumbRequest.load(o));
The reason that I'm not satisfied using this request is that the items in the GridView are likely to be modified, so I need to use a signature to ensure that the cache is invalidated when this occurs.
case 2: cloning the request and adding a signature, crashes immediately when scrubbing
fullRequest.clone().load(o).signature(key).thumbnail(thumbRequest.clone().load(o).signature(key));
case 3: creating a new request using a GlideRequests object provided to the adapter, crashes immediately when scrubbing
Stack trace / LogCat:
The text was updated successfully, but these errors were encountered: