EventBus 3.0 registerSticky deprecated

Cannot resolve registerSticky (this) method instead of register (this)

@Override public void onStart() { super.onStart(); EventBus.getDefault().register(this); } 

I tried 'org.greenrobot: eventbus: 3.0.0' and 'de.greenrobot: eventbus: 3.0.0-beta1' in my Gradle. I do not know why this method does not appear

+5
source share
1 answer

RegisterSticky seems to be out of date and removed. I think you should register as a normal event and then use the postSticky method

 @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) public void onEvent(MessageEvent event) { //... } 

Please contact: http://greenrobot.org/eventbus/documentation/configuration/sticky-events/

+10
source

Source: https://habr.com/ru/post/1243019/


All Articles