0

I am trying to navigate from a fragment to another one fragment after the creation of post. It shows the Declared target fragment that does not belong to this FragmentManager. I have upgraded to androidx.fragment manager

 final FragmentTransaction transaction = getFragmentManager().beginTransaction();
                        BaseFragment fragment = HomeFeed.newInstance(mValuesItem, CreatePost.this);
                        final String tag = BaseUtils.getTag(fragment);
                        transaction
                                .replace(getFragmentContainerId(), fragment, tag)
                                .addToBackStack(tag)
                                .commit();
Henry
  • 41,816
  • 6
  • 58
  • 77
sejn
  • 1,493
  • 3
  • 20
  • 55

0 Answers0