This is a general Java question and not an Android one first off!
I\'d like to know how to run code on the main thread, from the context of a secondary thread. For e
You may want to use the 'even dispatching thread' where most event driven things happen. If you are using swing then:
SwingUtilities.invokeLater(new Runnable() { public void run() { Your code here. } });
Or create a class that implements Runnable and pass it into invokeLater().