Android GreenRobot EventBus

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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.


Got any Android Question?