hi mate i have a simple thread that i want to terminate when flag interrupt is on. this is the code at the begin of run method
conn = false;
for (int i=0; (isInterrupted() == false) && (i < TRY_CONNECT) && !conn; i++) {
try{
Log.d(TAG,"TRY"+i);
sock.connect();
conn = true;
} catch (IOException e) {
try {
sleep(5000);
} catch (InterruptedException e1) {
Log.d(TAG,"CATCH int");
break;
}
}
}
if(isInterruped() == true)
Log.d(TAG,"INT");
out the thread i call on him interrupt method, and it dont terminate the loop.. he dont see the interrupt that i call... how is possible ? For debug: out where i call interrupt i insert two print with log cat ... thread_reader.interrupt(); boolean b=thread_reader.isInterrupted(); Log.d(TAG,""+b); and on log cat the system print "false" how is possible ? i ve just call interrupt