0

I have a app they use Android.Support.V4.App.Fragment. Is it possible to launch a new Fragment from a "parent" Fragment?

For example Fragment A switch to Fragment B and when you press back from the Fragment B it change for the Fragment A.

Thanks.

Maxime
  • 357
  • 2
  • 10
  • 23

1 Answers1

0

This code will help you.

getActivity().getSupportFragmentManager()
    .beginTransaction()
    .replace(R.id.your_tab_id, new FragmentClassName())
    .commitAllowingStateLoss();
Sujith Thankachan
  • 3,508
  • 2
  • 20
  • 25