I am using a timer in one of my widgets. Basically the widget has to
make an RPC call every X milliseconds to update its content. Now I am
trying to make it so every 5 minutes, it makes an RPC call. And simple
as it looks I do this:
I have defined the delay as a class variable:
private final int delayMiliSecs = 300000; // 5 min
In widget's onLoad():
@Override
protected void onLoad() {
this.keepAlive();
};
private void keepAlive(){
this.timer = new Timer(){
@Override
public void run() {
RealTimeWidget.this.getNotifications();
}
};
this.timer.scheduleRepeating(delayMiliSecs);
}
But the RPC call happens rather every few seconds instead of 5 minutes.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.