GreenRobot EventBus

Download android eBook

Syntax

  • @Subscribe(threadMode = ThreadMode.POSTING) public void onEvent(EventClass event) { }

Parameters

Thread ModeDescription
ThreadMode.POSTINGWill be called on the same thread that the event was posted on. This is the default mode.
ThreadMode.MAINWill be called on the main UI thread.
ThreadMode.BACKGROUNDWill be called on a background thread. If the posting thread isn't the main thread it will be used. If posted on the main thread EventBus has a single background thread that it will use.
ThreadMode.ASYNCWill be called on its own thread.

Related Examples

Stats

223 Contributors: 3
Thursday, October 27, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook