How to force a WebImageView to reload?

208 Views Asked by At

Using droid-fu, how can I make a WebImageView re-download the picture and display it? Think of a webcam refreshing every 5 minutes...

I tried a button calling a method like:

public void refresh() {
    webcam1.reset();
    webcam1.setImageUrl(webcam1url);
    webcam1.loadImage();
}

where webcam1 is my WebImageView, but the it never reloads, I just have the loading wheel forever in place of the new image.

1

There are 1 best solutions below

0
On BEST ANSWER

The solution was to implement clearCache() method in WebImageView and refresh the whole activity:

public void refreshImages() {
    webcam1.clearCache();
    startActivity(getIntent());
    finish();
    overridePendingTransition(0, 0);
}