I have an application in which an activity communicates with our server and gets the outstanding amount details. I want users to pay the outstanding amount using a payment g
You can make use of Intent.putExtra()
while navigating using Intents, Shared Preferences and also Bundle. Please read Android documentation for Shared Preferences, Intents, Bundle
You could achieve what you want using a javascript WebAppInterface as demonstrated here.
The main concept is that, you create a javascript interface inside the Activity holding your WebView.
private class WebPayInterface {
int amount;
boolean success;
@JavascriptInterface
public void PaymentFinished(int amount, boolean success) {
this.amount = amount;
this.success = success;
// do whatever you want in the parent activity.
}
}
Add the interface to your webView
webView.addJavascriptInterface(new WebPayInterface(), "WebPayInterface");
Finally in your html code using javascript you can call
WebPayInterface.PaymentFinished(100, true);