title: Android 2.2 Implements Runnable Public void run() not being called
body: <p>I have the following:-</p>
  
  <pre><code>public class resApp extends MapActivity implements Runnable {
  
      public void run() {
          searchImage.setVisibility(View.GONE);
      }
  
  }
  </code></pre>
  
  <p>I also have a background thread that runs before this but that seems to run ok.</p>
  
  <p>When i run the app the run() never gets called.</p>
  
  <p>Can you help?
  This code did work about 6 months ago but the device was 2.1.</p>
  
  <p>Thanks</p>
  
  <p>Chris</p>
  
  <hr>
  
  <p>edit</p>
  
  <p>I had already implemented </p>
  
  <pre><code> private Handler handler;
  
   handler = new Handler() {
   @Override
  public void handleMessage(Message msg) {
      if (msg.toString().equalsIgnoreCase("1")) {
      ad.dismiss();
      } else {
      pd.dismiss();
      }
  }
   };
  </code></pre>
  
  <p>as an example and I already have an asynchronous task that runs in the back ground and in 2.1 I could have getters and setters in there. I have now had to pull these out and put them into the run() method as 2.2 doesn't like setting onclicklistener in an async task.
  All I need to do is call the run() method on post execute but have tried everything:-</p>
  
  <pre><code>protected void onPostExecute(Object result) {
  // Pass the result data back to the main activity
  if (dialog != null) {
      resApp.this.dialog.dismiss();
  }
  }
  </code></pre>
  
  <p>Could I just do:-</p>
  
  <pre><code> handler = new Handler() {
      @Override
  public void handleMessage(Message msg) {
      this.resApp.run();
  }
   };
  </code></pre>