title: how to restart a thread in android?
body: <p>in my android app i have an ui-update-thread that keeps all my views up-to-date. </p>
  
  <pre><code>protected Thread UIUpdateThread = new Thread()
  {
   @Override
   public void run()
   {
    while(true)
    {
      query_some_data_from_service(); // gets some "fresh" data from a service
      UIUpdateHandler.sendEmptyMessage(0); // will update all ui elements with the new values
      sleep(1234);
    }
   }
  };
  </code></pre>
  
  <p>i start this thread in onCreate() with </p>
  
  <pre><code>UIUpdateThread.start();
  </code></pre>
  
  <p>and everything works just fine :) when i leave the activity (e.g. because i switch to another activity) i call </p>
  
  <pre><code>UIUpdateThread.interrupt();
  </code></pre>
  
  <p>within onStop() to prevent the thread from running all the time. if i dont do this, it would keep running even if i close the app !?!?!!</p>
  
  <p>problem is: how do i bring this thread back to life when returning from some other activity to this one? run() doesnt work, calling the initial start() in some other method like onResume() crashes the app.</p>
  
  <p>i already tried a lot of things, but nothing seems to work :(</p>