1

I using FragmentDialog for subscribe on events using otto library.

  @Subscribe
    public void onPickupRequestResponse (PassengerPickupRequestResponseEvent event){
        Toast.makeText(this.getActivity().getApplicationContext(), "Event handled", Toast.LENGTH_SHORT).show();
        dismiss();
    }

I register FragmentDialog in OnResume event and unregister in onPause methods.

 @Override
    public void onResume() {
        super.onResume();
        App.bus.register(this); 
    }

    @Override
    public void onPause() {
        super.onPause();
        App.bus.unregister(this);         
    }

Then in activity I post event

 App.bus.post(new PassengerPickupRequestResponseEvent());

But my FragmentDialog does not handle this event.

Oksana
  • 13,442
  • 10
  • 53
  • 89

1 Answers1

0

Instead of the onResume and onPause you can override the dismiss() to unregister and in the onCreateDialog method you can register the Bus. Then you should be able to interact with the Bus.

Arne Poths
  • 76
  • 4