I have this thread.
class Hilo1 extends Thread {
@Override
public void run() {
while (contador<6) {
try {
Thread.sleep(10000);
runOnUiThread(new Runnable() {
@Override
public void run() {
contador++;
}
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
This thread finishes after a minute, because it runs every 10 seconds and it does that 6 times. When it´s done, I´d like to do some tasks, but I don´t know how to detect when it finishes. I have read about isAlive() method but my project doesn´t let me use it. I´d like to detect when it finishes so I can do the next tasks that have to be done once Hilo1 has finished. Thank you.