简体   繁体   中英

Web View HTML in Android

I'm using Web View in my app. I want to pass a value to HTML. For example, I'm making an online payment system; I want to pass a variable that holds the amount to the HTML that will display in my web view.

Any thoughts?

You can maintain variables in JavaScript and pass it to your WebView after a page is loaded in it. Use it as follows:

webview.loadUrl("javascript:var a=(%s);",data);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM