I have an application in which I run a new action and there must be a result before continuing.
I understand that startActivityForResult is asynchronous / non-blocking and that I can get the result of activity in the onActivityResult callback.
So, I think what I'm looking for is the best way to wait for activity to return ... Is something like this possible? Or is there a better way?
Startup launch function:
public String ActivityLauncher()
{
startActivityForResult(intent, 1);
while (mIsActivityDone == false)
{
Thread.Sleep(250);
}
String data = "<Data from Activity">
return data;
}
Callback:
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
mIsActivityDone = true;
}
The data must be returned to a higher level call function - this is why I need to wait for the result in the ActivityLauncher function.
Thank!