Skip to content

Instantly share code, notes, and snippets.

@subodh-malgonde
Created December 9, 2015 11:14
Show Gist options
  • Save subodh-malgonde/e06552e02b3e1b083375 to your computer and use it in GitHub Desktop.
Save subodh-malgonde/e06552e02b3e1b083375 to your computer and use it in GitHub Desktop.
Boilerplate introduced by activity to fragment communication in the Android framework
FragmentManager fragmentManager = getFragmentManager();
FragmentA fragmentA = (FragmentA) fragmentManager.findFragmentByTag(FragmentA.TAG);
if(fragmentA != null && fragmentA.isAdded()){
fragmentA.foo()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment