Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development
i am developing a game in which i am repeating a while loop(i.e.., code sent by u for moving the objects in a line. if i want to stop tht immediately then wat should i do to stop it? is there any method? to stop the threads immeditely?
- Posts: 19
- Joined: Sun Feb 11, 2007 8:52 am
use a boolean variable in the class which is always false when you run the loop. At any stage when you want to stop the thread you make it true. And also change the while loop such that the code will come out of the while loop when the boolean is true and then return from the run function. this will automatically stop the thread...
- Site Admin
- Posts: 661
- Joined: Tue Aug 15, 2006 8:39 am
- Location: India
Return to J2ME Games
Who is online
Users browsing this forum: No registered users and 1 guest