How do I return a ListenableFuture with work manager 2.0?

后端 未结 1 1724
轻奢々
轻奢々 2020-12-10 00:15

It seems ListenableWorker no longer has the @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) restriction however I can\'t figure out or find examples on how to properly return a

相关标签:
1条回答
  • 2020-12-10 00:17

    As per the Threading in ListenableWorker documentation page:

    You can create ListenableFutures one of two ways:

    1. If you use Guava, use ListeningExecutorService.
    2. Otherwise, include councurrent-futures in your gradle file and use CallbackToFutureAdapter.
    0 讨论(0)
提交回复
热议问题