As per this question:
Calling startIntentSenderForResult from Fragment (Android Billing v3)
Calling startIntentSenderForResult requires you to pass an Activity that implements onActivityResult(...). Fragments cannot implement this, so if you want to call the method from one, you have to pipe it through an Activity, presumably the Activity that created the Fragment.
My issue differs from the existing question in that I do not have an easily accessible Activity that I can implement onActivityResult on. My fragment is created by another fragment, and there is a lot of logic and domain object decoding etc. that occurs between that fragment and the "main" Activity that initiates the process.
So, for practical and architectural reasons, I'd really prefer not to pipe the callback into that Activity and back down into the calling fragment.
I am thinking of something like:
- fragment who performs the call creates a temporary Activity which contains a reference to the fragment and implements the onActivityResult, which handles the callback and routes back into the fragment.
Help of any kind will be greatly appreciated.