My answer to [this question](https://stackoverflow.com/questions/10607821/swapping-image-in-imageview/10608396#10608396) was just accepted but I started to wonder when exactly one needs to invalidate() a View and when it is not necessary?

After a bit of thinking I came to realization that it *should* work more or less like this:

* actual drawing of "everything" occurs after `onResume()`
* in "free" time parts of the screen can be redrawn but only those that were `invalidated` (and everything underneath)

Therefore, it would seem, if I change something after `onResume()` (e.g. as a response to a button click, I should `invalidate()` the changed `View`). 

However, from what scana in [this question](https://stackoverflow.com/questions/10607821/swapping-image-in-imageview/10608396#10608396) says, it must be more complex then that and it depends somethimes on what method one uses.

E.g. on whether one uses

```
lastClicked.setImageBitmap();

```

or

```
lastClicked.setImageResource();

```

So, when it's necessary to execute invalidate() on a View and how does it really work ?