Android: Fragments: Communicating between FragmentActivity and Fragment

In your FragmentActivity, you can call getSupportFragmentManager().findFragmentByTag(“tag”), or findFragmentById(, to access the child Fragment. From there you can call its methods.

Similarly, in the Fragment, you can call getActivity() to get access to the parent FragmentActivity().

You can also do this via events. See the android-fragments-events post.

android android-fragments

Edit on github
comments powered by Disqus
Click me