Skip to content

Instantly share code, notes, and snippets.

@tophyr
Created August 20, 2014 00:57
Show Gist options
  • Save tophyr/ed0ec9ff0fc5bb246670 to your computer and use it in GitHub Desktop.
Save tophyr/ed0ec9ff0fc5bb246670 to your computer and use it in GitHub Desktop.
public class FooFragment {
public interface IFooFragment {
void onMapReady(GoogleMap map);
}
somewhereLaterInCode() {
((IFooFragment)getActivity()).onMapReady(myMap);
}
}
public class MainActivity implements FooFragment.IFooFragment {
.
.
.
@Override
public void onMapReady(GoogleMap map) {
((SomeOtherFragment)(getFragmentManager().getFragmentByTag("some_other_fragment"))).setMap(map);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment