title: Java - switching back to main thread?
body: <p>How can I switch back to main thread from a different thread when there is an exception. When an exception is raised on a child thread, I want a notification to be sent to main thread and execute a method from the main thread. How can I do this?</p>
  
  <p>Thanks.</p>
  
  <p><b>Additional information</b></p>
  
  <p>I am calling a method from my main method and starting a new thread there after some calculations and changes</p>
  
  <pre><code>Thread thread = new Thread() {
      @Override
      public void run() {
          .....
      }
  }
  thread.start();
  </code></pre>