marcoms10 marcoms10 - 1 year ago 82
Android Question

How can I call a method from nested fragment

I have a fragment(this is one tab of my tabhost)

inside other fragment
but I need to call one method of
when I do from an activity, I do this:

FragB detailsFragment=(FragB)getSupportFragmentManager().findFragmentById(;


please, help me

Answer Source

I could finally solve it this way, in fragA:

FragB parentFragment = (FragB) getChildFragmentManager()
if (parentFragment != null) {
    parentFragment.consultaWS("", "AllPdf");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download