Oleh Liskovych
Oleh Liskovych

Reputation: 1061

Refresh image cache in ImageView

I have an imageView from which I take visible part of image with getDrawingCache(). It works well. But when I change image in imageView and try to get bitmap from it, getDrawingCache() returns bitmap of the first image. I tried to call this method buildDrawingCache() before calling getDrawingCache() but it didn't help.

How can I refresh cache or associated bitmap or I don`t know what in order to get new image?

Upvotes: 0

Views: 832

Answers (1)

Oleh Liskovych
Oleh Liskovych

Reputation: 1061

Solution was very simple:

   imageView.destroyDrawingCache();
   imageView.buildDrawingCache();
   imageView.getDrawingCache();

Upvotes: 1

Related Questions