I have two application separately.Client and Seller App. I want to pay money for client app and get response to seller app. Anyway,i have deep linking concept enabled in seller app. Client App : It has three Activity Page inside client app.getting details(first activity page) and show confirmation(second activity) and payment is third Activity. Note:Open Client App using Seller App, fill all details and payment from client app and send response to Seller App. for this client side i have set code for this:
Intent object = new Intent();
object.putExtra("data", "3434434343343");
setResult(Activity.RESULT_OK, object);
finish();
for Seller App Code:
protected void onActivityResult(int ResCode, int ReqRes, Intent data) {
super.onActivityResult(ResCode, ReqRes, data);
if (ResCode == 1 && ReqRes == Activity.RESULT_OK && data != null) {
String response = data.getStringExtra("data");
}
}
Problem Here: from client side Successfully passing Data using setResult.then, Seller app activity successfully calling onActivityResult also,But, Intent data is coming as NULL only.Because,here client side am using multiple activities using then only, am passing result.thats my problem. If anyway is there to get the onActivityResult from multiple chain link activities( external App Activities) means, its useful for me.
Note: I have found one solution, if two App having a single activity means, Its properly setresult and OnactivityResult is calling and getting data.But, My scenario if for Multiple chain link Activities for Client Side App.
Please any help to come out this Issue. Thanks Advance
Based on your use case scenario above, I believe a better architecture which would allow such a communication would be if the client app utilizes a
Fragment
based setup. Here, you can start the client activity from the seller app, let the user navigate to different fragments there and then usesetResult()
whereever suitable. Since, this is a one-to-one activity result setting behavior, it should work.Another suggestion which you can try, given you don't want to go the fragment way is within the client app, as the user travels to different activities you can immediately call
finish()
in them and then in the final activity callsetResult()
. This probably won't work but, a [very] small part of me says it might :).You can navigate from
ThirdActivity
toFirstActivity
, then return back to your seller app in theonNewIntent
method of yourFirstActivity
.After all the three procedures finished, your client app should have the following stacks.
And your
ThirdActivity
is on the top of the stack. YourThirdActivity
can navigate to theFirstActivity
by using the following codeThen in your
FirstActivity
, you can set the data and return to your seller app.