本文整理匯總了Java中chatty.util.ActivityTracker類的典型用法代碼示例。如果您正苦於以下問題:Java ActivityTracker類的具體用法?Java ActivityTracker怎麽用?Java ActivityTracker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ActivityTracker類屬於chatty.util包,在下文中一共展示了ActivityTracker類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import chatty.util.ActivityTracker; //導入依賴的package包/類
public void show() {
if (activityTime <= 0 || ActivityTracker.getLastActivityAgo() < activityTime) {
startTimer(false);
} else {
activityListener = new MyActivityListener();
ActivityTracker.addActivityListener(activityListener);
}
startFallbackTimer();
visibleSince = System.currentTimeMillis();
window.setVisible(true);
}
示例2: close
import chatty.util.ActivityTracker; //導入依賴的package包/類
/**
* Close the window immediately and cleanup.
*/
public void close() {
stopTimers();
closed = true;
window.dispose();
if (listener != null) {
listener.notificationRemoved(this);
}
if (activityListener != null) {
ActivityTracker.removeActivityListener(activityListener);
}
}
示例3: setActivityTime
import chatty.util.ActivityTracker; //導入依賴的package包/類
/**
* Sets the time in seconds in which activity should have been detected to
* be considered active. Automatically starts tracking if it's greater than
* 0. Values <= 0 disable this feature (however tracking may still be
* active).
*
* @param time
*/
public final void setActivityTime(int time) {
this.activityTime = time * SECOND;
if (activityTime > 0) {
ActivityTracker.startTracking();
}
}