 <pre><code>YourActivity.this.runOnUiThread(new Runnable() { public void run() { //What you want to do, updating a UI in main thread ect. } }); </code></pre> <p>you could also refer to another post <a href="http://stackoverflow.com/questions/14986146/update-android-ui-from-a-thread-in-another-class">HERE</a></p>