java - android webview loading remote html file with local javascript/css file -


i have website structure

<html> <head></head> <body>  <script src=".style/js/javascript.js"></script> <link rel="stylesheet"  href="./style/css/ipars.css" /> </body> </html> 

i want host js , css (with css inline images) locally in android app. create www folder in assect folder , move style folder in it. , change code this:

<html> <head></head> <body>  <script src="file:///android_asset/www/style/js/javascript.js"></script> <link rel="stylesheet"  href="file:///android_asset/www/style/css/ipars.css" /> </body> </html> 

now browse website webview js , css not work!

this java code in android-studio:

public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) {         view v =inflater.inflate(r.layout.tab_1, container, false);           webview webview = (webview) v.findviewbyid(r.id.webview1);          // wepars.com php         string agentmodified = webview.getsettings().getuseragentstring().concat(" mobileapplication(com.wepars.webapp)");         webview.getsettings().setuseragentstring(agentmodified);          websettings websettings = webview.getsettings();         websettings.setjavascriptenabled(true);         webview.setwebviewclient(new webviewclient());          webview.loadurl("http://www.example.com");         return v;     } 

what wrong?

edit/ not dublicate: checked link. local html. want remote html.


Comments