if (percentComplete > 100) {
percentComplete = 100;
}
ApplicationInstance app = getApplicationInstance();
if (app != null) {
app.enqueueTask(taskQueue, new ProgressUpdateTask(percentComplete));
try {
Thread.sleep((long) (Math.random() * 1000));
} catch (InterruptedException ex) { }
}
}