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
  • 42,982
  • 7
  • 68
  • 84
sejn
  • 2,040
  • 6
  • 28
  • 82

0 Answers0