Reputation: 18489
In one of my project i am using 2 fragments.one fragment is displaying a list of items.So i want when the topic will be selected in first fragment the details should be changed in another fragment.Data i am able to pass from one fragment to other but the view is not changing.In which method i should implement the view of second fragment so that it can change accordingly.
Upvotes: 0
Views: 4745
Reputation: 28168
See this link. It describes exactly your problem.
Basically, you have a listener on the items fragment to be notified on each item selection. The class implementing the listener interface may be the Activity or even the other fragment. When the listener is notified, it updates the details fragment.
Upvotes: 2