1
My app has an Activity that controls the inclusion of Fragments.
Follows:
public static void adicionarFragment(Activity activity, Fragment fragment){
FragmentManager fragMgr = activity.getFragmentManager();
FragmentTransaction fragTrans = fragMgr.beginTransaction();
fragTrans.replace(android.R.id.content, fragment);
fragTrans.addToBackStack(null);
fragTrans.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
fragTrans.commit();
}
I wonder if it is possible to find out which Fragment is being displayed ?
Is there any way to use FragmentManager
?
Ps: I tried to in this way, but he does not return to me the instance of Fragment
Perfect! Thank you very much!
– Thiago Luiz Domacoski