AI-generated Key Takeaways
-
ListenableResultFutureextends the standardFutureto provide a callback mechanism for results. -
Results are delivered to the
OnResultListenerprovided viasetOnResultListener, ensuring execution on the UI thread. -
It inherits methods from
Futurefor managing task cancellation and retrieving results (e.g.,get(),cancel()). -
This interface facilitates asynchronous operations with UI updates by simplifying result handling on the main thread.
A Future that accepts an onResult listener that will be called on the UI thread.
Nested Class Summary
| interface | ListenableResultFuture.OnResultListener<T> | Interface definition for a callback to be invoked when a result is available. | |
Public Method Summary
| abstract void |
setOnResultListener(OnResultListener<T> listener)
Sets the listener that will be called when a result is available.
|
Inherited Method Summary
Public Methods
public abstract void setOnResultListener (OnResultListener<T> listener)
Sets the listener that will be called when a result is available. The listener will be called on the UI thread.
Parameters
| listener | the callback this future will invoke when a result is available |
|---|