I have a service that starts a thread in 15 seconds. This is a piece of code:
Handler mHandler = new Handler();
OverclockThread ocThread = new OverclockThread();
ocThread.ocPreference = readPreference("oc");
ocThread.serviceOn = true;
if (Intent.ACTION_SCREEN_ON.equals(action)) {
ocThread.screenOff = false;
mHandler.postDelayed(ocThread, 15000);
}
Now I would like to add the ability to stop the start of my ocThread until these 15 seconds ... for example, by clicking a button or a check box ... which command should I use to stop the thread started using postDelayed?
thank
Simone
source
share