webView.getSettings().setJavaScriptEnabled(true);
webView.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.addJavascriptInterface(new PaymentSucess(this), "Payment");
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
// webView.loadUrl(myResult);
}
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
}
});
}
class PaymentSucess {
Activity activity;
public PaymentSucess(CC_Avenue_Paymentview cc_avenue_paymentview) {
activity = cc_avenue_paymentview;
}
@JavascriptInterface
public void submit() {
Log.d("Url", webView.getUrl());
}
@JavascriptInterface
public void cancel() {
Log.d("Url", webView.getUrl());
}
}
public void goSucessPage(Url url){
}