Your question does not contain enough details, but because of the sound of things, you are in a private inner class (Runnable?) In your activity (Main). If so, you can either write:
Main.this.runOnUiThread(mRunnable);
or
runOnUiThread(mRunnable); //will see that there is no runOnUiThread in the current class and begin looking "upwards"
In addition, you can look at AsyncTask , in particular, onPostExecute , onPreExecute and onProgressUpdate that run in the user interface thread.
source share