EventBus - 从未使用过@Subscribe 注释方法

EventBus - @Subscribe annotated method is never used

使用 greenrobot EventBus 库时,所有 @Subscribe 注释的方法都以浅灰色显示并带有警告 Method onMyEvent() is never used in Android工作室。

有没有办法自动抑制此警告(因为该方法不是直接从代码中调用,而是响应事件总线上的事件)?

您可以通过指向浅灰色代码的左侧将其关闭。

然后在出现灯泡图标后,点击 select 'Suppress method annotated by org.greenrobot...'


更新

在以下位置找到了 EventBus 3 IntelliJ 的新工作插件 eventbus3-intellij-plugin. This is a working fork of Shinnosuke Kugimiya eventbus3-intellij-plugin.

使用 Android Studio 2.1.3。