Correct approach to update UI in Android
<p>I'm new to Android stuff. Currently I have someone else code in my hand and I'm trying to understand the functionality. Whoever wrote the code, used Handler and messages in it. For example, if a button is clicked, onClick listener is called which then posts a message to handler. Inside the handler there is a switch case statement which calls different methods based on a data passed in Message what attribute.</p>

<p>My question is, is this a correct approach or we should just call our method directly in the onClick handler.</p>

<p>As i understand, handler should be used to post a message to the main UI thread, from some other thread (worker thread which pulls data from server).</p>
