How To Communicate Between Fragments and Activities in Android
original source : http://simpledeveloper.com/how-to-communicate-between-fragments-and-activities/
https://stackoverflow.com/a/25392549/3151712
이 내용은 fragment와 activity간의 통신을 말하고 있다.
fragments간의 통신은 다르면 아래 참고내요을 확인할것.
The easiest way to communicate between your activity and fragments is using interfaces. The idea is basically to define an interface inside a given fragment A and let the activity implement that interface.
Once it has implemented that interface, you could do anything you want in the method it overrides.
The other important part of the interface is that you have to call the abstract method from your fragment and remember to cast it to your activity. It should catch a ClassCastException if not done correctly.
There is a good tutorial on Simple Developer Blog on how to do exactly this kind of thing.
I hope this was helpful to you!
참고로 읽으면 좋은 android doc
https://developer.android.com/training/basics/fragments/communicating.html
fragments간의 통신 방법은 아래를 참고
android programming -big nerd ranch p224