Android webview, loading javascript file in assets folder

前端 未结 5 1897
我在风中等你
我在风中等你 2020-11-29 01:09

I\'ve seen this question has been asked a lot of times, but still can\'t manage to get my code working.

I want my webview to load some URL (say www.google.c

5条回答
  •  悲&欢浪女
    2020-11-29 01:59

    Maybe you could have assets as 'html/javascript templates'. You could combine different of these text sources and string logic to compose your desired html to be loaded into the WebViewer. Then, you use .loadData instead of .loadUrl

    I'm using it on my own and it seems to work pretty well.

    Hope it helps!

提交回复
热议问题