title: Android basics: running code in the UI thread
body: <p>In the viewpoint of running code in the UI thread, is there any difference between:</p>
  
  <pre><code>MainActivity.this.runOnUiThread(new Runnable() {
      public void run() {
          Log.d("UI thread", "I am the UI thread");
      }
  });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>MainActivity.this.myView.post(new Runnable() {
      public void run() {
          Log.d("UI thread", "I am the UI thread");
      }
  });
  </code></pre>
  
  <p>and</p>
  
  <pre><code>private class BackgroundTask extends AsyncTask&lt;String, Void, Bitmap&gt; {
      protected void onPostExecute(Bitmap result) {
          Log.d("UI thread", "I am the UI thread");
      }
  }
  </code></pre>