1
在哪裏/當我應該添加索引的綠色機器人事件總線庫:事件總線指數
EventBus.builder().addIndex(new MyEventBusIndex()).installDefaultEventBus();
描述here?我已將這個onCreate()方法應用於我的啓動器活動,但有時會得到:
Caused by: org.greenrobot.eventbus.h: Default instance already exists. It may be only set once before it's used the first time to ensure consistent behavior.
我在哪裏錯了?非常感謝。
我不知道,但你可能希望把它在構造函數(不帶任何參數): '公共MainActivity(){EventBus.builder()addIndex(新MyEventBusIndex())installDefaultEventBus(。 ); }' – Chaoz