I think the easiest way to ask the question would be to demonstrate how my current workflow is set up first:
- There is a
TabHostthat has anActivityGroupas one of its tabs - That
ActivityGroupas anActivityin it that calls an external service that I have no control over. - The External Service has a callback function that kicks off
onActivityResultin theActivityGroupand NOT in theActivitythat called the Service. This is because in order to have even have theonActivityResultfire, I had to callgetParent().startActivityForResult(
The problem is that I want ‘stuff’ to happen in the Activity that called the External Service (e.g. an Alert Dialog, a web service call etc).
So, how can a call a non-static method in the child Activity from the ActivityGroup? Is this even possible?
I figured it out. In the
ActivityGroup‘sonActivityResultI got the current activity usinggetLocalActivityManager().getCurrentActivity()and edit: cast it as the class I need, then called the non-static method on it: