AndroidRX - run method in background

前端 未结 5 1758
独厮守ぢ
独厮守ぢ 2021-02-12 15:38

I created simple activity with infinity progres bar, and I\'am trying to run time consuming method using RxJava to prevent UI thread from blocking, but everytime UI thread is bl

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-12 16:05

    Also, you can use RxJavaAsyncUtil:

    compile 'io.reactivex:rxjava-async-util:0.21.0'
    

    Code:

    Observable.fromFunc0(() -> doHeavyStuff())
    

提交回复
热议问题