-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Compiler Warnings as Errors - WordPress Module - OnActivityResult #17249
Copy link
Copy link
Closed
Description
Parent #17173
This issue is about resolving the onActivityResult(...), startActivityForResult(...) and requestPermissions(...) compile warnings for the WordPress module, and possibly, for the lib modules as well.
PS: Some of those warnings are already deprecated (see here, here and here).
- This
onActivityResult(...)method has been deprecated in favor of using the Activity Result API which brings increased type safety via anActivityResultContractand the prebuilt contracts for common intents available inandroidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. UseregisterForActivityResultwith the appropriateActivityResultContractand handling the result in the callback. - This
startActivityForResult(...)method has been deprecated in favor of using the Activity Result API which brings increased type safety via anActivityResultContractand the prebuilt contracts for common intents available inandroidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. UseregisterForActivityResultpassing in aStartActivityForResultobject for theActivityResultContract. - This
requestPermissions(...)method has been deprecated in favor of using the Activity Result API which brings increased type safety via anActivityResultContractand the prebuilt contracts for common intents available inandroidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. UseregisterForActivityResultpassing in aRequestMultiplePermissionsobject for theActivityResultContractand handling the result in the callback.
For more info see:
Reactions are currently unavailable