Interface BackgroundTask.ProgressListener<T,V>

Type Parameters:
T - progress measurement unit
V - result type
All Known Implementing Classes:
BackgroundTask.ProgressListenerAdapter
Enclosing class:
BackgroundTask<T,V>

public static interface BackgroundTask.ProgressListener<T,V>
Listener of the task life cycle events, complementary to the tasks own methods: BackgroundTask.progress(List), BackgroundTask.done(Object), BackgroundTask.canceled().
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called by the execution environment in UI thread if the task is canceled.
    void
    onDone(V result)
    Called by the execution environment in UI thread when the task is completed.
    void
    onProgress(List<T> changes)
    Called by the execution environment in UI thread on progress change.
  • Method Details

    • onProgress

      void onProgress(List<T> changes)
      Called by the execution environment in UI thread on progress change.
      Parameters:
      changes - list of changes since previous invocation
    • onDone

      void onDone(V result)
      Called by the execution environment in UI thread when the task is completed.
      Parameters:
      result - result of execution returned by BackgroundTask.run(TaskLifeCycle) method
    • onCancel

      void onCancel()
      Called by the execution environment in UI thread if the task is canceled.