Skip to main content

Posts

Showing posts with the label stop

Android: How do I stop Runnable?

I tried this way: private Runnable changeColor = new Runnable() { private boolean killMe=false; public void run() { //some work if(!killMe) color_changer.postDelayed(changeColor, 150); } public void kill(){ killMe=true; } }; but I can't access kill() method!