2
I have this Code
final Handler handler = new Handler();
final Runnable r = new Runnable() {
public void run() {
if (garagem.isChecked()!= luzgaragem){
garagem.setChecked(luzgaragem);
//Quando chegar aqui parar tudo
}else {
handler.postDelayed(this, 1000);
System.out.println("estou aqui");
}
}
};
handler.postDelayed(r, 1000);
How can I create a loop and stop it when give if true ??
I also managed with this command Handler.removeCallbacksAndMessages(null);
– Guilherme
@With this line, the change is irreversible. Using my example, it is reversible.
– mutlei