Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stoping a Thread

 
Maddi Ranjan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Maddi Ranjan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your tips...
I solve the problem using state variable and callBack method
[ June 23, 2005: Message edited by: Maddi Ranjan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic