Android – how to call methods from nested fragments

I have a fragment (this is a label of my tabhost) "Fraga" in other fragments "fragb", but I need to call a "fragb" method from "Fraga". When I do an activity, I do this:

FragB detailsFragment=(FragB)getSupportFragmentManager().findFragmentById(R.id.detailFragment);

detailsFragment.consultaWS(convertIntWebService(categoria),"Pdf");

Please help me

resolvent:

I can finally solve it like this. In Fraga:

FragB parentFragment = (FragB) getChildFragmentManager()
                                      .findFragmentByTag("detallesFragBusqueda");
if (parentFragment != null) {
    parentFragment.consultaWS("", "AllPdf");
}

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>