Comments (8)
I would like that functionnality too !
It would be great if we would be able to put the componant with two attributes: CACHE and NO-CACHE
from android-smart-image-view.
You can clear the cache and it will reload the images from the server
WebImageCache cache = new WebImageCache(context);
cache.clear();
So you could do it manually(I do mine when the user logs out) or you could do some sort of http request that checks if the image should be cleared.
You could also just use the source files in your program and remove all the cache calls.
from android-smart-image-view.
Thanks for the answer ! :D
I'll use the cache.clear() method ! Very useful if we need to refresh the picture from the server.
I think this should be on the documentation !
Thanks !
from android-smart-image-view.
Actually, I try to refresh the picture from the Internet. So here is my code:
WebImageCache cache = new WebImageCache(getBaseContext());
cache.clear();
myImage2.setImageUrl(/* URL */);
But it does not work :s What is wrong ? :s
from android-smart-image-view.
I noticed this also with my images in a list view even though I verified that my cache was empty. I believe that it is due to the way android recycles views so they aren't refreshed until I scroll down then back up.
You might try myImage2.img.setImageResource(0); to clear the image then myImage2.setImageUrl("http..."); to refresh it. you would still need to clear the cache though because otherwise it would keep filling up.
If your image is going to be changing every time you app needs it you would be better off just using the source code in your project and removing the cache calls(faster than dealing with clearing cache all the time).
edit:
You can even for off this repo and create your own version without caching
from android-smart-image-view.
Thanks ! :) I tried "myImage2.img.setImageResource(0);" , but it didn't worked. So I checked WebImage.java's code, and commented the two lines
"bitmap = webImageCache.get(url);" (line 32) and
"webImageCache.put(url, bitmap);" (line 36),
and now it works !
Thanks a lot ! :) I hope this thread will help someone
from android-smart-image-view.
FAIK, it will be getting images from external also isn't it?
from android-smart-image-view.
WebImageCache cache = new WebImageCache(getActivity());
cache.clear();
Use this code inside the viewHolder where the data is populating.
from android-smart-image-view.
Related Issues (20)
- not loading image on smart image view progmatically
- Still OutOfMemory issues
- Some images are loaded as ColorDrawable while some as BitmapDrawable
- Crash application HOT 1
- I build a HTTP server in local,then use SmartImageView.setImageUrl(String url)
- Error when saving cache file for very long URL: ENAMETOOLONG (File name too long)
- Out of memory HOT 1
- Loaded Images Mix Up While Scrolling In List View Adapter HOT 5
- develop to get facebook image HOT 1
- Very choppy scrolling in a ListView with SmartImageView
- How to set a progressloader for Images in ListView
- geographique card HOT 1
- Progressive download feature
- Need zoom capability
- Update cached image
- Regard to APK File
- Gradle dependencie
- Cache removal control
- Still supported
- Crash Aplicattion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-smart-image-view.