java - Android webview script tag not loading source file -
i'm trying load javascript file script tag in webview, won't load it!
here's source html script tag:
<script type="text/javascript" src="file:///android_asset/game/tetris.js"></script>
and java file:
webview webview; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.loadurl("file:///android_asset/game/tetris.html"); }
i've tried , without "file:///android_asset/game/" , still won't load!
any ideas? thanks!
i same in applications relative paths, , works fine me.
in case i'd use src="tetris.js"
in html
Comments
Post a Comment