This is not an specific problem, but everytime I have to update an View on my android application I have to search A LOT to see what is wrong with my code. Btw not only with android, but mobile in general.
So there’s any rules/cases for this kind of task?
I mean, when i can use Invalidate, when i have to use a Handler, and so on..
Thanks in advance
According to me, when you use an “Handler”, you put an anchor in the UI Thread so that your views are still accessible whenever you want.
When you post “invalidate” you say “Hey! Could you refresh my view when you are able to?”. If you are on the UI Thread, it can execute immediately (or nearly). If you’re inside another Thread, it “posts” a demand and the UI will be refreshed when your activity will be back to the UI thread.