I am using GreenRobot EventBus , I wanted to define some Threading properties, according to docs,
However, when I write:
@Subscribe(threadMode = ThreadMode.MAIN)
public void onShowNotification(NotificationEvent event) {
if(event == NotificationEvent.bannerEvent) {
updateContents();
}
}
I get an error that threadMode is not recognized by compiler specifying method: cannot resolve method 'threadMode'
i have on my gradle file:
implementation 'org.greenrobot:eventbus:3.1.1'
I suspect that your project uses another library which also has a
@Subscribekeyword. Can you try CMD+B when the cursor in the@Subscriberand go to the definition, does it go toorg.greenrobot.eventbu.Subscribe?The takeaway here: when error
cannot resolve methodhappens, you can always go to the definition to check what happens there :)