Is it possible to start a MIDlet, which spawns a thread, then return control to the phone so the user can operate the phone normally, but still have the thread running in the background? If so can you provide reference material or examples?
Derek Smith
Greenhorn
Joined: Jan 28, 2002
Posts: 5
posted
0
I have done what you are asking by putting thread creation and starting in the commandAction() routine of the Midlet. This is a common way to handle background/multithreaded network connections, etc.
//create thread for login INETThread login = new INETThread(INETThread.LOGIN, strUID, strPIN); login.start(); The thread will run but any code that follows from the .start() will allow control of phone by user..so you can display a screen, etc. Check out http://wireless.java.sun.com/midp/articles/threading/ for good example. DMS
subject: Spawn thread and return control to phone?