Grrr.
onModuleLoad() {
// launch task 1
// launch task 2
// display wait message, or whatever
}
onTask1Finished() {
task1Finished = true;
maybeContinue();
}
onTask2Finished() {
task2Finished = true;
maybeContinue();
}
maybeContinue() {
if (task1Finished && task2Finished) {
// we're running from an event dispatch so handlers we add to the
EventBus are deferred, and firing an event synchronously wouldn't trigger
them, so we defer the whole thing
Scheduler.get().scheduleFinally(new ScheduledCommand() {
@Override
public void execute() {
// create your activity handlers, then:
historyHandler.handleCurrentHistory();
}
});
}
}
The first 3 methods you already have, the last one too, just missing that
damn Scheduler bit; i.e. 5 damn lines.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/JLkTwwU0F7QJ.
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.