Android: Calling method from thread <p>I have a handler for a thread in my <code>MainActivity</code> that calls a method named <code>UpdateGUI</code>.</p> <p>Both the handler/thread declaration and the method are within the <code>MainActivity</code>.</p> <p>This is the handler Declaration:</p> <pre><code>Handler handlerData = new Handler(); private Runnable runnableCode2 = new Runnable() { @Override public void run() { Log.d("Handlers","GET TOTAL RX BYTES: "+Long.toString(res) ); //Some code here that doesn't matter/ UpdateGUI(); } handlerData.postDelayed(runnableCode2, 1*6000); } }; </code></pre> <p>And <code>UpdateGUI</code> is as follows:</p> <p><code>public void UpdateGUI(){ Log.d("Updater", "STARTING UPDATE"); //Code that doesn't matter here} }</code></p> <p>From the logger I can see that <code>UpdateGUI()</code> is not being called from the thread. Can you explain why this is happening and how it can be fixed?</p> <p>Just to clarify. The thread is running,but for some reason it doesn't make the call to UpdateGUI().</p>