I have made an activity A which has a fragment X in it. In fragment X, EditText item has on click event which opens fragment Y. This fragment displays a list of names. I pre
To use setTargetFragment()
, both the new Fragment
and the target Fragment
must be hosted within the same FragmentManager
. The most common case where this would not happen is if you are using Activity.getSupportFragmentManager()
or Fragment.getFragmentManager()
alongside Fragment.getChildFragmentManager()
.