Forums Register Login

Stoping a Thread

+Pie Number of slices to send: Send
Hi all,

I have a serious problem to stop a thread and its execution, Actually I want to stop the thread also its listener, and again restart it. I use this thread for socket and http and file connection, during this connection Screen display a progress bar, Now if the user press the clear button then the apps back to the previous screen and imediately thread will stop and also its remainig code block. But I cant do it properly Please give me solution how can i do it as soon as posible

regards
Maddi
+Pie Number of slices to send: Send
How about setting the reference to the Thread to null and calling the Garbage Collector?

Maybe you could create a "callback" method in the Thread, that you can call from the Midlet thread that would stop its processing or close the connection.

Mark
+Pie Number of slices to send: Send
Thanks for your tips...
I solve the problem using state variable and callBack method
[ June 23, 2005: Message edited by: Maddi Ranjan ]
Let me tell you a story about a man named Jed. He made this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 706 times.
Similar Threads
Protecting for loop values
ServerSocket crash with Thread
Contradictory requirements
Need to stop a thread(possibly)
Parent Thread stops then does child thread also stop?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:19:36.