Perhaps I'm missing something. Application A seems to start an Activity in Application B for a result and implements onActivityResult. The way you've constructed the Intent to send has some issues, but let's skip that for a moment.
As far as I can tell, the form of the Intent you send is immaterial, because Application B is never looking at it. The receiving Activity should have a call to getIntent(). Based on the incoming ACTION, it set a result code and return Intent, call setResult(), and then call finish(). Your code isn't doing this; instead, it seems like you're trying to start Application A by calling startActivityForResult().
I understand why you might have tried this, but the sequence should be:
- Activity A wants to start Activity B (regardless of Activity B's application).
- Activity A constructs Intent X that matches Activity B.
- Activity A calls startActivityForResult(X).
- Activity B comes to the foreground.
- The method onResume() in Activity B calls getIntent(). This ensures that Activity B can look at Intent X even if B was already running.
- Activity B does the action that was requested by Activity A.
- When done, Activity B puts its results in Intent Y.
- Activity B calls setResult(result_code, Y);
- Activity B calls finish(), which sends the result back to Activity A.
- The method onActivityResult() in Activity is triggered.
The result Intent Y is not sent by startActivityForResult; instead, it's send by a combination of setResult() and finish().