'What is the alternative for AutoResolveHelper.resolveTask in Android fragments?

I am trying to integrate Google Pay into my application and all seems fine until I have to resolve the task from PaymentClient.loadPaymentData(). It's being called from a fragment and as far as I know onActivityResult() has been deprecated in favor of registerForActivityResult(). I can't seem to find a way to resolve the task using this function. How do I do that?

For code reference I followed this tutorial: https://developers.google.com/pay/api/android/guides/tutorial#checkoutactivity.kt-kotlin and it recommends using AutoResolveHelper.resolveTask() but it uses onActivityResult() for its results.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source