setTargetFragment is deprecated

Has anyone been able to get this right?? The setTargmentFragment method is deprecated in chapter 13 and everything about this function or what to even replace it with is confusing, even the official docs itself.

I just want to know if anyone has any solution to this problem