-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Compiler Warnings as Errors - WordPress Module - TargetFragment #17250
Copy link
Copy link
Closed
Milestone
Description
Parent #17173
This issue is about resolving the getTargetFragment() and setTargetFragment(...) compile warnings for the WordPress module, and possibly, for the lib modules as well.
PS: Some of those warnings are already deprecated (see here).
- Instead of using a target fragment to pass results, the fragment requesting a result should use
FragmentManager.setFragmentResultListener (String, LifecycleOwner, FragmentResultListener)to register a
FragmentResultListenerwith arequestKeyusing its parent fragment manager. The fragment delivering a result should then callFragmentManager.setFragmentResult(String, Bundle)using the samerequestKey. Consider usingsetArgumentsto pass therequestKeyif you need to support dynamic request keys. - Instead of using a target fragment to pass results, use
FragmentManager.setFragmentResult(String, Bundle)to deliver results toFragmentResultListenerinstances registered by other fragments viaFragmentManager.setFragmentResultListener(String, LifecycleOwner, FragmentResultListener).
For more info see:
Reactions are currently unavailable