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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -