use of java.util.Timer in project glitch-hq-android by tinyspeck.
the class SkillDetailFragment method InitUpdateSkillRemainingTimer.
private void InitUpdateSkillRemainingTimer() {
if (m_RemainingTimer != null)
m_RemainingTimer.cancel();
m_RemainingTimer = new Timer();
m_RemainingTimer.scheduleAtFixedRate(new TimerTask() {
public void run() {
FragmentActivity act = getActivity();
if (act != null) {
act.runOnUiThread(new Runnable() {
public void run() {
if (m_currentSkill.learning && !m_currentSkill.paused && !m_currentSkill.got && !m_fromUnlearn)
UpdateSkillDetailProgress();
else if (m_currentSkill.unlearning)
UpdateUnlearnDetailProgress();
}
});
}
}
}, 1000, 1000);
}
use of java.util.Timer in project commons by twitter.
the class BufferedLog method start.
/**
* Starts the log submission service by scheduling a timer to periodically submit messages.
*/
private void start() {
long flushIntervalMillis = flushInterval.as(Time.MILLISECONDS);
new Timer(true).scheduleAtFixedRate(logPusher, flushIntervalMillis, flushIntervalMillis);
}
use of java.util.Timer in project Shuttle by timusus.
the class VideoCastControllerFragment method restartTrickplayTimer.
private void restartTrickplayTimer() {
stopTrickplayTimer();
mSeekbarTimer = new Timer();
mSeekbarTimer.scheduleAtFixedRate(new UpdateSeekbarTask(), 100, 1000);
LOGD(TAG, "Restarted TrickPlay Timer");
}
use of java.util.Timer in project syncany by syncany.
the class RecursiveWatcher method restartWaitSettlementTimer.
private synchronized void restartWaitSettlementTimer() {
logger.log(Level.FINE, "File system events registered. Waiting " + settleDelay + "ms for settlement ....");
if (timer != null) {
timer.cancel();
timer = null;
}
timer = new Timer("FsSettleTim/" + root.toFile().getName());
timer.schedule(new TimerTask() {
@Override
public void run() {
logger.log(Level.INFO, "File system actions (on watched folders) settled. Updating watches ...");
watchEventsOccurred();
fireListenerEvents();
}
}, settleDelay);
}
use of java.util.Timer in project syncany by syncany.
the class WatchOperation method scheduleForceKill.
private void scheduleForceKill() {
String killTimerName = "Kill/" + config.getLocalDir().getName();
new Timer(killTimerName).schedule(new TimerTask() {
@Override
public void run() {
try {
logger.log(Level.INFO, "STOP GRACE PERIOD OVER. STOPPING WATCH " + config.getLocalDir() + " ...");
if (watchThread != null && !watchThread.isInterrupted()) {
watchThread.interrupt();
}
} catch (Exception e) {
logger.log(Level.INFO, "Forcefully stopping watch thread FAILED at " + config.getLocalDir() + ". Giving up.");
}
}
}, STOP_GRACE_PERIOD);
}
Aggregations