Closed Bdiang closed 12 years ago
Can you try writing a failing test case for this behavior? I'll try to reproduce when I get time but a failing test case would more easily help in identifying the problem and surfacing a solution.
OK
I did more research and discovered that problem was in my code.
@Bdiang Can you please tell was what was the bug in your code since I'm seeing the same behavior - last saved item is present on disk but I'm not getting it from cache...
Actually I don't know. I had function IsKeyExists where I checked snapshot existance but not getting it. And in the loop last one was always not exists (but it was). I just stop using that functuion)
Thanks for your effort. Anyway, my problem was with android killing the app and journalWriter not beeing flushed so changes were lost... Its a known issue here as I've later discovered...
Hi!
I'm loading images in ListView from DiskLruCache. ListAdapter.getView() method creates AsyncTask which loads image from DiskLruCache. And there is very strange behavior - DiskLruCache.get() returns null on last one ListView element in bunch of lazy loaded ListView elements.
To simplify situation imagine loop:
for (i...) { SnapShot value = DiskLruCache.get("key"+i); }
For the last "i" value is null. A checked that on UI thread also, but still same result.
If it's not a bug but my mistake maybe someone would help me with issue?
Thanks!
P.S. DDMS shows that cache entry exist. Clearing and filling it again brings same result. P.P.S. It does not depend on items count. It could be different entry from time to time, but always last in bunch of get() calls