Cancel android thread programmatically -
i have thread:
t = new thread() { @override public void run() { try { while (!isinterrupted()) { thread.sleep(1); runonuithread(new runnable() { @override public void run() { timecounter++; textview.settext("your reaction time:" + timecounter + "ms"); } }); } } catch (interruptedexception e) { } } }; t.start();
i want cancel , tried t.interrupt();
didn't work, there other way?
i had issue related before. might find link useful how solved problem. also, mentioned, quite odd setting thread sleep 1 millisecond. thread isn't removed properly
Comments
Post a Comment