I can create a class which extends Thread and overrides the run method with a loop. I then start it with myThread.start(), which create the OS thread and executes my run(). That's all good.
However, I don't quite understand the details. I'll have a go at working this out using test code when I get the chance, but before then can anyone answer these:
Q1. When does the constructor get executed, presumably when myThread is declared, or on start()?
Q2. What happens when my run() code completes? Is there a way of getting it to run again in the same thread (i.e. not losing all the thread variable values defined in class) Presumably calling start() might create a new os thread?
Q3. Presumably just calling myThread.run() would execute my run() in the context of the current activity, not mythread, in which case how could it access the thread variables?)
-Frink