1

Activity 'A' and it has a drawer fragment. I need to change the drawer fragment specific imageview based on event posting from Activity 'B'.

In drawer fragment -

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

@Override
public void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}

@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onProfilePicChangeEvent(ProPicChangeEvent event) {

Glide.with(getActivity())
    .load(tinyDB.getString(ConstantPreference.KEY_PROFILE_PHOTO))
    .placeholder(R.drawable.image_placeholder).into(profileView);
}

In Activity 'B'

EventBus.getDefault().postSticky(new ProPicChangeEvent());

'onProfilePicChangeEvent' never called.But I have used eventbus through my project elsewhere and its always working. What can be the reason I don't know yet. need suggestion to figure this out

demo_Ashif
  • 195
  • 1
  • 12

0 Answers0