Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 328
friederbluemle Avatar asked Jun 25 '16 05:06

friederbluemle


1 Answers

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.

like image 51
ישו אוהב אותך Avatar answered Oct 12 '22 00:10

ישו אוהב אותך