Skip to content

Compiler Warnings as Errors - WordPress Module - OnActivityResult #17249

@ParaskP7

Description

@ParaskP7

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 an ActivityResultContract and the prebuilt contracts for common intents available in androidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. Use registerForActivityResult with the appropriate ActivityResultContract and 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 an ActivityResultContract and the prebuilt contracts for common intents available in androidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. Use registerForActivityResult passing in a StartActivityForResult object for the ActivityResultContract.
  • This requestPermissions(...) method has been deprecated in favor of using the Activity Result API which brings increased type safety via an ActivityResultContract and the prebuilt contracts for common intents available in androidx.activity.result.contract.ActivityResultContracts, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity. Use registerForActivityResult passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the callback.

For more info see:

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions