EventBus - @Subscribe annotated method is never used
Asked Answered
L

1

9

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

Laundes answered 25/6, 2016 at 5:2 Comment(0)
B
25

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.

Balalaika answered 25/6, 2016 at 5:8 Comment(4)
Thanks, that works! Is there a way to make this the default for a fresh clone via the build system or other config file, without committing IDE files (.idea/) to source control?Laundes
I don't know if there is another ways. But recently I found that there is a plugin for @Subscribe EventBus at Intellij Plugin for nagivation. Haven't try. If you've try it, please inform me..:DWoodford
@friederbluemle: Found a working plugin for EventBus!. Please read my updated answer ;)Woodford
Hi , how u fixed this issue ?Coleman

© 2022 - 2024 — McMap. All rights reserved.