How can i pass an object to a new thread generated anonymously in a button listener
<p>I would like to pass an object (docket for printing) to a new thread which will print the docket.  My code is:</p>

<pre><code>  private final Button.OnClickListener cmdPrintOnClickListener = new Button.OnClickListener() {

    public void onClick(View v) {
        new Thread(new Runnable() {
            public void run() {
                enableTestButton(false);
                Looper.prepare();
                doConnectionTest();
                Looper.loop();
                Looper.myLooper().quit();
            }
        }).start();

      }
};
</code></pre>

<p>How do I pass the object to it?
Also - I need to generate the object in the UI thread, just before starting the new thread so where could I put this method (e.g. getDocketObject()) in relation to my code below</p>

<p>thanks,</p>

<p>anton</p>
