how to disply my content on a html page in android -
i want display data's in html page,i make static html page in assest folder .but dont know how insert data's in html page programtically. please urgent.
loading html page asset relatively simple:
webview webview = (webview)view.findviewbyid(r.id.mywebview); webview.loadurl("file:///android_asset/index.html");
but programatically alter content of page you'd have first read asset file string, insert data string replace, or use java.text.messageformat.
here's code inputstream asset:
assetmanager mgr = this.getassets(); inputstream = mgr.open("index.html"); bufferedinputstream in = new bufferedinputstream(is); // read contents of file
once have html string populated, can programmatically set content of webview:
webview.loaddata(htmlstring, "text/html", "utf-8");
Comments
Post a Comment