title: Android - Proper way to wait for handler object to be created
body: <p>Folks,</p>
  
  <p>Here is a simplified code for my background thread:</p>
  
  <pre><code>    public class MyThread extends Thread {
        private Handler _handler;
  
        public void run() {
           Looper.prepare();
           this._handler = new Handler();
           Looper.loop();
        }
  
        public void DoSomething() {
           if (!this.isAlive()) {
              this.start();
           }
  
           this._handler.post(blah);
        }
      }
  </code></pre>
  
  <p>The problem I have is that the background thread may not have yet created the handler object when post() call is made. Essentially, I need a wait loop for the handler object to be initialized. What is generated accepted method of doing this under Android?</p>
  
  <p>Thank you in advance for your help.</p>
  
  <p>Regards,
  Peter</p>