ActivityResultContract
ActivityResultContract is a class in the Android Jetpack library that provides a standardized way to handle activity results. It abstracts away the complexities of starting an activity for a result and receiving that result back, offering a cleaner and more robust solution compared to the traditional `startActivityForResult` and `onActivityResult` methods.
The core idea behind ActivityResultContract is to define a contract between the caller and the called activity.
A typical implementation involves creating a class that extends `ActivityResultContract`. This class has two main methods:
To use an ActivityResultContract, you first register a callback with the `ActivityResultRegistry`. This is typically done
When you want to launch the activity, you call the `launch` method on the registered activity result