title: Android managing threads without using AsyncTask
body: <p>I have a project I am working on where I need to improve my knowledge on Threads.</p>
  
  <p><strong>Scenario:</strong>
  I have an Activity which calls a method Which use uses a thread:</p>
  
  <pre><code>Object soapResponse =  soaphttp.fetchNextCatalogueRange(0, numberOfItems);
  </code></pre>
  
  <p>In the soaphttp class I have:</p>
  
  <pre><code>Thread soapThread = new Thread(new Runnable()
      {           
          private Object serverResponse = new Object();
  
          public void run()
          {
  
                // Do network stuff here
  
  
          }   
      });
  
      soapThread.start();
     try
      {
          // crude synchronisation
          soapThread.join();
      }
  </code></pre>
  
  <p><strong>The problem</strong>
  Using join() blocks the UI thread. 
  If I dont use join() I get null pointer exceptions (data sync errors)</p>
  
  <p><strong>The Challenge:</strong>
  In my activity I would like to do stuff on the UI thread while the soaphttp class is fetching data and then sync i.e tell the UI thread that the data is ready.
  for example display a progress bar .. which will terminate when the data has finished being fetched.</p>
  
  <p>How can I do this without having to use AsyncTask ?</p>