friederbluemle
friederbluemle

Reputation: 37213

EventBus - @Subscribe annotated method is never used

When using the greenrobot EventBus library, all @Subscribe-annotated methods are displayed in light grey with a warning Method onMyEvent() is never used in Android Studio.

Is there a way to automatically suppress this warning (as the method is not directly called from code, but in response to an event on the event bus)?

Upvotes: 9

Views: 2704

Answers (1)

ישו אוהב אותך
ישו אוהב אותך

Reputation: 29844

You can turn it off by pointing to left of the light greyed code.

Then after bulb icon appear, click and select 'Suppress method annotated by org.greenrobot...'


UPDATE

Found new working plugin for EventBus 3 IntelliJ at eventbus3-intellij-plugin. This is a working fork of Shinnosuke Kugimiya eventbus3-intellij-plugin.

Working with Android Studio 2.1.3.

Upvotes: 25

Related Questions