File File - 1 year ago 109
Android Question

Communicate with fragment in backstack

I have problem with communicating between fragments. In first fragment I use listener to notify activity to open second fragment and pass him some data with Bundle. First fragment is in the backstack. Then, the second fragment opens and does some work with data. After it's finished, fragment should be closed and first fragment should be appear from backstack, but it should be notified about the changed data in second fragment. So, my question is how to notify first fragment that data is changed in second fragment?

Answer Source

If you want something more sophisticated for sending complex data, use Otto or EventBus Or you can use the LocalBroadcastManager.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download