How can I terminate my Midlet?

Started by
3 comments, last by RPGeezus 20 years, 3 months ago
Hi all, Stupid question, but one I''m struggling with. I have a main class (start) which extends MIDLET. It is not runnable. It instantiates a runnable class (running) and runs it in a thread. My question is this: A lot of my UI is controlled from the running thread. I need to exit the Midlet, but start the exit from the thread. What is the proper way of doing this? My thoughts so far have been to pass a reference of the Midlet to the thread, but I thought there might be a nicer way. Thanks, Will
------------------http://www.nentari.com
Advertisement
Killing the MIDlet, wouldn''t kill the threads created by the MIDlet?

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..
Hi Will,

I use a function in My MIDlet class

	public void exit()		{		System.out.println( "exit function" );		destroyApp(false);		notifyDestroyed();		}



Then i call this function from my Menu Class

Dont know of any other ways!
Maybe somebody will have a another way of doing it!

Brian
Thanks for the responses.

PipoDe: You are correct, but I wanted a way to kill the midlet via software, from another thread.

Woody: Thanks.. I guess I have no choice but to pass that reference after all. BTW: How''s your game comming along? I''m almost done-- just the highscore list, help, and a title screen left. Everything else is in it''s final state. I''d like to send you another copy for testing.

Will

------------------http://www.nentari.com
Yeah its all but done!

Send it on and i''ll test it!

This topic is closed to new replies.

Advertisement