I am using Greenrobot EventBus 3.0.0. I have a class A and it received an Object Event.In class A I modified that object and pass it to next Activity B.
@Override
protected void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onRowClicked(RequestDTO requestDTO) {
if (requestDTO!= null) {
EventBus.getDefault().post(requestDTO);
startActivity(new Intent(this, ActivityB.class));
}
}
The problem is that it stuck in infinite loop because publisher and subscriber same event.How to resolved that issue?