public interface ProgressListener
Modifier and Type | Method and Description |
---|---|
void |
onChange(Progress progress)
This method will be called periodically from the underlying Object Server Client responsible
for uploading and downloading changes from the remote Object Server.
|
void onChange(Progress progress)
This callback will not happen on the UI thread, but on the worker thread controlling
the Object Server Client. Use Activity.runOnUiThread(Runnable)
or similar to update
any UI elements.
// Adding an upload progress listener that completes when all known changes have been
// uploaded.
session.addUploadProgressListener(ProgressMode.CURRENT_CHANGES, new ProgressListener() {
\@Override
public void onChange(Progress progress) {
activity.runOnUiThread(new Runnable() {
\@Override
public void run() {
updateProgressBar(progress);
}
});
if (progress.isTransferComplete() {
session.removeProgressListener(this);
}
}
});
progress
- an immutable progress change event with information about current progress. This object is thread safe.