title: how can I pass a variable into a new Runnable declaration?
body: <p>I have the following :</p>
  
  <pre><code>Runnable done = new Runnable()
      {
          public void run()
          {
              System.out.println("Hello");
          }
      };
  </code></pre>
  
  <p>And then in my Android activity I'll call something like : </p>
  
  <pre><code>runOnUIThread(done);
  </code></pre>
  
  <p>Which I then call. However, I want that <code>"Hello"</code> not to be hardcoded, so I can pass it in. Otherwise I'll have to have one of these declarations for every String I want to print.</p>
  
  <p>(This is actually an android question, but slimmed it down to basic Java so its easier to answer)</p>
  
  <p>Thanks</p>