Declared target fragment that does not belong to this FragmentManager in androidx (Android studio java)

736 Views Asked by At

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();
0

There are 0 best solutions below