How to send event from Service to Activity with Otto event bus?

后端 未结 7 1754
心在旅途
心在旅途 2020-12-02 05:19

Simple BusProvider.getInstance().post() bring exception not main thread. How to send event from Service to Activity with Otto event bus?

7条回答
  •  温柔的废话
    2020-12-02 06:05

    Just create the BasicBus with ThreadEnforcer.NONE to post event from non-main threads. The mentioned ThreadEnforcer.MAIN is exactly the opposite (and the default), which accepts only posts from the main-thread.

提交回复
热议问题