title: Returning value from Thread
body: <p>I have a method with a <code>HandlerThread</code>. A value gets changed inside the <code>Thread</code> and I'd like to return it to the <code>test()</code> method. Is there a way to do this?</p>
  
  <pre><code>public void test()
  {   
      Thread uiThread = new HandlerThread("UIHandler"){
          public synchronized void run(){
              int value; 
              value = 2; //To be returned to test()
          }
      };
      uiThread.start();
  }
  </code></pre>