Since the setTargetFragment() is deprecated. What would be the best way to return data to to CrimeFragment ?
I’ve tried to use the SetFragmentResultListener() method but since this method involves adding the result to a bundle, I’m wondering how to add a Date variable to the result bundle ? Thanks.
CrimeFragment.Java
getChildFragmentManager().setFragmentResultListener(REQUEST_KEY, this, new FragmentResultListener() {
@Override
public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle bundle) {
// no getDate method
String result=bundle.getString("bundleKey");
mDateButton.setText(result);
}
}