title: Why run Handler in main Looper thread
body: <p>I read that the Android <a href="https://developer.android.com/reference/android/os/Handler" rel="nofollow noreferrer">Handler</a> can be used to communicate with the main <a href="https://developer.android.com/reference/android/os/Looper" rel="nofollow noreferrer">Looper</a> thread to post messages that will interact with the views(since only main thread can interact with views there)</p>
  
  <p>But I often see code like the example below that run the <a href="https://developer.android.com/reference/android/os/Handler" rel="nofollow noreferrer">Handler</a> in the main thread. Why is that a good think to do, it feels unnecessary unless there is a delay like <code>postDelayed(new Runnable()...</code> </p>
  
  <p>Any explanation on this would bee nice</p>
  
  <pre><code>public class TaleDemoActivity extends AppCompatActivity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_demo);
  
          new Handler().post(new Runnable() {
              @Override
              public void run() {
                  new Handler().post(new Runnable() {
                      @Override
                      public void run() {
                          new Tale("Hello runnables!").tell();
                      }
                  });
                  new Handler().post(new Runnable() {
                      @Override
                      public void run() {
                          new Tale("Hello runnables!").at().tell();
                      }
                  });
              }
          });
  
          new Handler().post(new TestRunnable());
          new Handler().post(new TestStaticRunnable());
  
          new Handler().post(new TestAbstractRunnable() {
              @Override
              public void run() {
                  new Tale("Hello abstract runnable!").tell();
              }
          });
          new Handler().post(new TestInterfaceRunnable() {
              @Override
              public void run() {
                  new Tale("Hello test interface runnable!").tell();
              }
          });
  
          new Tale().at().tell();
      }
  
      class TestRunnable implements Runnable {
          @Override
          public void run() {
              new Tale("Hello testRunnable!").tell();
          }
      }
  
      static class TestStaticRunnable implements Runnable {
          @Override
          public void run() {
              new Tale("Hello testStaticRunnable!").tell();
          }
      }
  
      abstract class TestAbstractRunnable implements Runnable {
  
      }
  
      interface TestInterfaceRunnable extends Runnable {
  
      }
  }
  </code></pre>