Timer timer = new Timer() {
@Override
public void run() {
connect(sessionId, cometCallback);
}
};
timer.schedule(1000);
It seems that the pause shouldn't be too small. 1 sec seems to be
enough, but it should be checked on slow machines too.