标签:style blog ar color sp java div log bs
it seems all stop methods of thread have been deprecated by java. so how to stop a thread then? it is actually simple, just use a boolean variable.
public class Test extends Thread{ public boolean running= true; public void shut(){ running= false; } public void run(){ while(running){ /*your method goes here*/ } } }
标签:style blog ar color sp java div log bs
原文地址:http://www.cnblogs.com/miaoz/p/4147770.html