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

Do you find the solution? Please guide me here. Thanks in advance.

Since setTargetFragment is deprecated, you will have to make use of the FragmentResultListener to be able to pass data from one fragment to another.

And I think there is no need to pass in a child or parent Fragment except one fragement is hosting other, but in my case I did that. It may not be the best looking solution but that was then and you make yours look better Criminal-Intent-App/CrimeFragment.kt at d29019006ea7f7df335c5a4d6f128ee35fe96c64 · daniel-iroka/Criminal-Intent-App · GitHub