Passing data from java class to Web View html

前端 未结 5 2189
情书的邮戳
情书的邮戳 2020-11-27 03:52

I\'m loading below html in my webView

https://mail-attachment.googleusercontent.com/attachment/?ui=2&ik=25c0c425c6&view=att&th=138db54ff27a

5条回答
  •  隐瞒了意图╮
    2020-11-27 04:22

    Pass the paramter directly in the url

    webView.loadUrl("file:///android_asset/animation.html?message=testing");
    

    Get the paramter in html file

    var url_string = window.location.href
    var url = new URL(url_string);
    var message= url.searchParams.get("message");
    

提交回复
热议问题